Download hmc/reference/scripts/man_sizes.py from neurodeskorg/webapps: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/datasets/neurodeskorg/webapps/resolve/main/hmc/reference/scripts/man_sizes.py
- Command line
-
hf download hf://datasets/neurodeskorg/webapps/hmc/reference/scripts/man_sizes.py
-
curl -L -o man_sizes.py https://huggingface.co/datasets/neurodeskorg/webapps/resolve/main/hmc/reference/scripts/man_sizes.py
976 Bytes
| """Print the sizes and facts of the images listed in a QSIPrep collected manifest.""" | |
| import json | |
| import os | |
| import sys | |
| from pathlib import Path | |
| m = json.loads(Path(sys.argv[1]).read_text()) | |
| def tot(items): | |
| return sum(os.path.getsize(i["path"]) for i in items), len(items) | |
| for k, v in m["model_iterations"].items(): | |
| print(k, "pred", tot(v["predictions"]), v["predictions"][0]) | |
| print(k, "regs", len(v["registrations"]), v["registrations"][0]) | |
| mv = m["moving_images"] | |
| print("moving", type(mv), len(mv)) | |
| print(mv[0] if isinstance(mv, list) else list(mv.items())[:1]) | |
| if isinstance(mv, list): | |
| print("moving total", tot(mv)) | |
| print("b0_mean", m["b0_mean"]) | |
| print("init tmpl", m["b0_initial_template"]) | |
| print("tmpl mask", m["b0_template_mask"]) | |
| print("outputs", json.dumps(m["outputs"], indent=1)[:2500]) | |
| print("b0stage", {k: len(v) for k, v in m["b0_stage"].items()}) | |
| print(m["b0_stage"]["iterative_alignment_001"][0]) | |
| print(m["seeds"], m["workflow_settings"]) | |