Mouse-Imaging-Centre/minc-stuffs

rotational_mintracc crashes if run without a mask

Opened this issue · 9 comments

rotational_minctracc.py -t /dev/shm/ -w 0.448,0.448,0.448 -s 0.224 -g 0.56 -r 50 -i 10 --simplex 1.12 embryo_mia_24122018_processed/img_28nov18.10.sept2014_dist_corr_preproc/tmp/img_28nov18.10.sept2014_dist_corr_preproc_fwhm0.28_blur.mnc embryo_mia_24122018_reg_target_resampled/tmp/E18.0_39micron_resampled_fwhm0.28_blur.mnc embryo_mia_24122018_processed/img_28nov18.10.sept2014_dist_corr_preproc/transforms/img_28nov18.10.sept2014_dist_corr_preproc_lsq6.xfm /dev/null
[autocrop] [gumeli@cicws37:/data/chamal/projects/elisa/embryo_mia/derivatives] [2019-01-03 15:43:35] /opt/quarantine/minc-toolkit/1.9.16/install/bin/mincresample embryo_mia_24122018_processed/img_28nov18.10.sept2014_dist_corr_preproc/tmp/img_28nov18.10.sept2014_dist_corr_preproc_fwhm0.28_blur.mnc //dev/shm//rot_23164/rot_0..mnc -start -7.8373 -7.44048 -12.3214 -step 0.224 0.224 0.224 -nelements 58 64 113
Transforming slices:.................................................................................................................Done
[autocrop] [gumeli@cicws37:/data/chamal/projects/elisa/embryo_mia/derivatives] [2019-01-03 15:43:40] /opt/quarantine/minc-toolkit/1.9.16/install/bin/mincresample embryo_mia_24122018_reg_target_resampled/tmp/E18.0_39micron_resampled_fwhm0.28_blur.mnc //dev/shm//rot_23164/rot_1.mnc -start -1.2 -2.4 -2.28 -step 0.224 0.224 0.224 -nelements 60 83 109
Transforming slices:.............................................................................................................Done
TMP: /dev/shm/
RANGE: 50 INTERVAL: 10
Traceback (most recent call last):
  File "/opt/quarantine/minc-stuffs/0.1.24^minc-toolkit-1.9.16/install/bin/rotational_minctracc.py", line 4, in <module>
    __import__('pkg_resources').run_script('python-stuffs==0.1.24', 'rotational_minctracc.py')
  File "/opt/quarantine/anaconda/5.1.0-python3/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/quarantine/anaconda/5.1.0-python3/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1534, in run_script
    exec(script_code, namespace, namespace)
  File "/opt/quarantine/minc-stuffs/0.1.24^minc-toolkit-1.9.16/install/lib/python3.6/site-packages/python_stuffs-0.1.24-py3.6.egg/EGG-INFO/scripts/rotational_minctracc.py", line 422, in <module>
  File "/opt/quarantine/minc-stuffs/0.1.24^minc-toolkit-1.9.16/install/lib/python3.6/site-packages/python_stuffs-0.1.24-py3.6.egg/EGG-INFO/scripts/rotational_minctracc.py", line 413, in main
  File "/opt/quarantine/minc-stuffs/0.1.24^minc-toolkit-1.9.16/install/lib/python3.6/site-packages/python_stuffs-0.1.24-py3.6.egg/EGG-INFO/scripts/rotational_minctracc.py", line 181, in loop_rotations
AttributeError: 'NoneType' object has no attribute 'data'

Any update on this? Running into this problem again.

Did you try the most recent develop (72b88fa)?

I haven't tried any development versions and I wasn't aware that any changes had been made there.... I really wish github would give me some way to follow all commits on a project...

I'm sorry, I should have tagged the issue in the commit so you'd get a notification.

git-develop instead:

Traceback (most recent call last):
  File "/opt/quarantine/minc-stuffs/git-develop/install/bin/rotational_minctracc.py", line 4, in <module>
    __import__('pkg_resources').run_script('python-stuffs==0.1.23', 'rotational_minctracc.py')
  File "/opt/quarantine/anaconda/5.1.0-python3/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/quarantine/anaconda/5.1.0-python3/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1534, in run_script
    exec(script_code, namespace, namespace)
  File "/opt/quarantine/minc-stuffs/git-develop/install/lib/python3.6/site-packages/python_stuffs-0.1.23-py3.6.egg/EGG-INFO/scripts/rotational_minctracc.py", line 436, in <module>
  File "/opt/quarantine/minc-stuffs/git-develop/install/lib/python3.6/site-packages/python_stuffs-0.1.23-py3.6.egg/EGG-INFO/scripts/rotational_minctracc.py", line 427, in main
  File "/opt/quarantine/minc-stuffs/git-develop/install/lib/python3.6/site-packages/python_stuffs-0.1.23-py3.6.egg/EGG-INFO/scripts/rotational_minctracc.py", line 274, in loop_rotations
TypeError: minctracc() got an unexpected keyword argument 'source_mask'

Added:

(f" -source_mask {source_mask} " if source_mask else "") +

and testing

oh and

minctracc(source, target, target_mask, source_mask, stepsize, wtranslations, simplex, use_lsq12_for_alignment):

Thanks. At some point when I was making these changes I realized @nzxwang was making a branch to generalize a bunch of settings including adding LSQ3/.../12 but I never got around to porting to that branch and for some reason left the changes in an inconsistent state.

However, I have neural brain segmentation now so hopefully brute-force rotations will soon be a thing of the past :)

Yup that fixes it up.

I can't help but feel that all my drilling down into bending registration tools to my will is going to be completely supplanted when I'm replaced by a neural network...