This was developed to properly register CT to MR images, and to fix issues with LeGui with bad-registrations and flipped MR images.
It contains two main entry points. One to fix legui, another to run a MR to CT registration
You only need to do this once!
This requires Python 3.9 or later. To run this on the cluster, where this is not available, it's easiest to
- build a singularity image that contains Python 3.10
- Run that image with
exec
, with file path bindings back to this source code to set up a python environment - Run that image with
exec
, with the above binddings to this source code, and to/data/
to process data
To build the image:
cd
to the top directory of this solution- In bash:
build-as-apptainer/build-python-only.sh
Build the environment (once only)
/.build.sh
./RegisterMRToCT.sh --t1 path-to-your-t1.nii --ct path-to-your-ct.nii --out path-to-a-directory-to-save-to
# Activate once per session
env/bin/activate
# Run with Python
env/bin/python3.10 -m RegisterMRToCT
Check main.sh
and main.py
for details
Not implemented.
./main.sh /directory/containing/legui/folder /path/to/t1
will output to /directory/containing/legui/fixed_legui/