Subdivide MINC Volume
544

This repository contains several wrapper scripts for increasing the resolution of MINC volumes by subdividing voxels along their edges and performing interpolation.
It can be ran as a ChRIS ds-plugin, in which case it applies
several methods of subdivision to every MINC file found in its
input directory, writing outputs to a given output directory.
These results are quantified and the aggragate statistics are
written to summary.json.
ep-subdivide-mnc-methods is a ChRIS plugin, meaning it can
run from either within ChRIS or the command-line.
To get started with local command-line usage, use Apptainer
(a.k.a. Singularity) to run ep-subdivide-mnc-methods as a container:
singularity exec docker://fnndsc/ep-subdivide-mnc-methods subdivide [--args values...] input/ output/
To print its available options, run:
singularity exec docker://fnndsc/ep-subdivide-mnc-methods subdivide --help
subdivide_minc.pyWrapper around mincresample (part of minc tools).
subdivide_minc.py./subdivide_minc.py --divisions=8 input_volume.mnc output_subdivided_linear.mnc
# or
./subdivide_minc.py --divisions= --options=-cubic input_volume.mnc output_subdivided_cubic.mnc
Flags can be passed directly to mincresample using --options=.... See
man mincresample
for options.
mincresample interpolates values along voxel boundaries to smoothen the output.
The options are -trilinear (default for registration step in CIVET), -tricubic,
-nearest_neighbour, and -sinc.
subdivide_nibabel.pyIncreases the resolution of a volume without interpolation by computing the Kronecker product.
subdivide_nibabel.pypip install numpy nibabel h5py
# or
conda install numpy nibabel h5py
Optional dependency on nii2mnc for output to MINC file format.
subdivide_nibabel.py./subdivide_nibabel.py --divisions 4 input_volume.nii subdivided_output.nii
Both MINC and NIFTI file formats are supported.
Instructions for developers.
Run tests using pytest inside a container.
docker build -t localhost/fnndsc/ep-subdivide-mnc-methods:dev --build-arg extras_require=dev .
docker run --rm -it -u "$(id -u):$(id -g)" \
-v "$PWD/examples:/examples:ro" \
-v "$PWD:/app:ro" -w /app \
localhost/fnndsc/ep-subdivide-mnc-methods:dev \
pytest -v -o cache_dir=/tmp/pytest
Content type
Image
Digest
sha256:c997d89ab…
Size
2.3 GB
Last updated
over 3 years ago
docker pull fnndsc/ep-subdivide-mnc-methods