Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
8f31b82c
Commit
8f31b82c
authored
Feb 03, 2026
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated default paths
parent
fb16f180
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
README.md
scripts/README.md
+3
-3
catalog.json
scripts/catalog.json
+3
-3
mcp_filter_list_by_model_version.py
scripts/mcp_filter_list_by_model_version.py
+18
-13
No files found.
scripts/README.md
View file @
8f31b82c
...
...
@@ -22,16 +22,16 @@ Path: `scripts/mcp_filter_list_by_model_version.py`
Example:
```
bash
/home/elphel/git/imagej-elphel/scripts/mcp_filter_list_by_model_version.py v89
/home/elphel/git/imagej-elphel/scripts/mcp_filter_list_by_model_version.py
/media/elphel/btrfs-data/lwir16-proc/NC/lists/nc_site.list
v89
```
Inputs:
-
MCP server (http://127.0.0.1:48888)
-
list file
(default: /media/elphel/btrfs-data/lwir16-proc/NC/lists/nc_site.list
)
-
list file
path (required
)
-
model version (from MCP dialog or CLI argument)
Outputs:
-
Filtered .list file
(default: /home/elphel/git/imagej-elphel/attic/CODEX/lists/nc_site-v89
.list)
-
Filtered .list file
in the same directory as input (name suffixed with -
<version>
.list)
Dependencies:
-
MCP server
...
...
scripts/catalog.json
View file @
8f31b82c
...
...
@@ -7,13 +7,13 @@
"purpose"
:
"Filter a .list file to keep only sequences with an existing model version subdir."
,
"inputs"
:
[
"MCP server (http://127.0.0.1:48888)"
,
"list file
(default: /media/elphel/btrfs-data/lwir16-proc/NC/lists/nc_site.list
)"
,
"list file
path (required
)"
,
"model version (from MCP dialog or CLI argument)"
],
"outputs"
:
[
"Filtered .list file
(default: /home/elphel/git/imagej-elphel/attic/CODEX/lists/nc_site-v89
.list)"
"Filtered .list file
in the same directory as input (name suffixed with -<version>
.list)"
],
"example"
:
"/home/elphel/git/imagej-elphel/scripts/mcp_filter_list_by_model_version.py v89"
,
"example"
:
"/home/elphel/git/imagej-elphel/scripts/mcp_filter_list_by_model_version.py
/media/elphel/btrfs-data/lwir16-proc/NC/lists/nc_site.list
v89"
,
"tags"
:
[
"mcp"
,
"list"
,
"models"
,
"filter"
],
"dependencies"
:
[
"MCP server"
,
"-Delphel.mcp.allowed.configdir"
],
"owner"
:
"codex"
,
...
...
scripts/mcp_filter_list_by_model_version.py
View file @
8f31b82c
...
...
@@ -8,9 +8,6 @@ import urllib.request
MCP_BASE
=
"http://127.0.0.1:48888"
LIST_PATH
=
"/media/elphel/btrfs-data/lwir16-proc/NC/lists/nc_site.list"
OUT_PATH
=
"/home/elphel/git/imagej-elphel/attic/CODEX/lists/nc_site-v89.list"
LABEL_VERSION
=
"x3d model version"
LABEL_DIALOG
=
"Setup CLT Batch parameters"
...
...
@@ -63,15 +60,15 @@ def get_version_from_mcp():
return
version
def
read_list_file
():
data
=
parse_json
(
http_get
(
"/mcp/fs/read"
,
{
"path"
:
LIST_PATH
,
"offset"
:
0
,
"maxBytes"
:
1024
*
1024
},
timeout
=
30.0
))
def
read_list_file
(
list_path
):
data
=
parse_json
(
http_get
(
"/mcp/fs/read"
,
{
"path"
:
list_path
,
"offset"
:
0
,
"maxBytes"
:
1024
*
1024
},
timeout
=
30.0
))
if
not
data
.
get
(
"ok"
):
raise
RuntimeError
(
"Failed to read list file"
)
return
data
.
get
(
"data"
,
""
)
def
parse_set_paths
(
list_text
):
base_path
=
os
.
path
.
dirname
(
LIST_PATH
)
def
parse_set_paths
(
list_text
,
list_path
):
base_path
=
os
.
path
.
dirname
(
list_path
)
root_dir
=
None
linked_models
=
None
x3d_dir
=
None
...
...
@@ -126,9 +123,12 @@ def glob_v_dirs(version, models_dir):
def
main
():
version
=
sys
.
argv
[
1
]
if
len
(
sys
.
argv
)
>
1
else
get_version_from_mcp
()
list_text
=
read_list_file
()
models_dir
=
parse_set_paths
(
list_text
)
if
len
(
sys
.
argv
)
<
2
:
raise
SystemExit
(
"Usage: mcp_filter_list_by_model_version.py <list_path> [version]"
)
list_path
=
sys
.
argv
[
1
]
version
=
sys
.
argv
[
2
]
if
len
(
sys
.
argv
)
>
2
else
get_version_from_mcp
()
list_text
=
read_list_file
(
list_path
)
models_dir
=
parse_set_paths
(
list_text
,
list_path
)
seqs
,
lines
=
parse_sequences
(
list_text
)
if
not
seqs
:
raise
RuntimeError
(
"No sequences found"
)
...
...
@@ -180,14 +180,19 @@ def main():
else
:
out_lines
.
append
(
"#"
+
raw
)
os
.
makedirs
(
os
.
path
.
dirname
(
OUT_PATH
),
exist_ok
=
True
)
with
open
(
OUT_PATH
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
base_name
=
os
.
path
.
basename
(
list_path
)
if
base_name
.
endswith
(
".list"
):
out_name
=
base_name
[:
-
5
]
+
f
"-{version}.list"
else
:
out_name
=
base_name
+
f
"-{version}.list"
out_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
list_path
),
out_name
)
with
open
(
out_path
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
"
\n
"
.
join
(
out_lines
)
+
(
"
\n
"
if
out_lines
else
""
))
print
(
f
"Version: {version}"
)
print
(
f
"Models dir: {models_dir}"
)
print
(
f
"Sequences kept: {len(keep)} / {len(seqs)}"
)
print
(
f
"Output: {
OUT_PATH
}"
)
print
(
f
"Output: {
out_path
}"
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment