[BUG] amap registration: reg_aladin.exe has stopped working
See original GitHub issueDescribe the bug While performing amap registration, after starting “affine registration”, the amap program throws a dialog box saying “reg_aladin.exe has stopped working”
To Reproduce The command that gave this error:
amap "C:\Users\7057mehrav\Downloads\145-063-better-cropped" "C:\Users\7057mehrav\Downloads\145-063-output" -x 10 -y 10 -z 20
Expected behavior Output folder with bunch of “.nii” files after successful registration
Log file The error log didn’t save any output so I am pasting the log from the console right here:
2020-06-13 13:01:34 PM - INFO - MainProcess main.py:203 - Starting affine registration
Traceback (most recent call last):
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\imlib\general\system.py", line 275, in safe_execute_command
cmd, stdout=log_file, stderr=error_file, shell=True
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\imlib\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo C:\Users\7057mehrav\Downloads\145-063-output\brain_filtered.nii -ref C:\Users\7057mehrav\Downloads\145-063-output\downsampled_filtered.nii -aff C:\Users\7057mehrav\Downloads\145-063-output\affine_matrix.txt -res C:\Users\7057mehrav\Downloads\145-063-output\affine_registered_atlas_brain.nii -omp 44' returned non-zero exit status 255.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\amap\register\brain_registration.py", line 76, in register_affine
self.paths.tmp__affine_error_path,
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\imlib\general\system.py", line 300, in safe_execute_command
cmd,
imlib.general.system.SafeExecuteCommandError:
-------------------------
Process failed:
-------------------------
-------------------------
please read the logs at C:\Users\7057mehrav\Downloads\145-063-output\affine.log and C:\Users\7057mehrav\Downloads\145-063-output\affine.err
-------------------------
command: c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\imlib\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo C:\Users\7057mehrav\Downloads\145-063-output\brain_filtered.nii -ref C:\Users\7057mehrav\Downloads\145-063-output\downsampled_filtered.nii -aff C:\Users\7057mehrav\Downloads\145-063-output\affine_matrix.txt -res C:\Users\7057mehrav\Downloads\145-063-output\affine_registered_atlas_brain.nii -omp 44
-------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\7057mehrav\AppData\Local\Continuum\anaconda3\envs\cellfinder2\Scripts\amap.exe\__main__.py", line 7, in <module>
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\amap\cli.py", line 480, in main
run()
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\amap\cli.py", line 458, in run
debug=args.debug,
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\amap\main.py", line 204, in main
brain_reg.register_affine()
File "c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\amap\register\brain_registration.py", line 80, in register_affine
"Affine registration failed; {}".format(err)
imlib.general.exceptions.RegistrationError: Affine registration failed;
-------------------------
Process failed:
-------------------------
-------------------------
please read the logs at C:\Users\7057mehrav\Downloads\145-063-output\affine.log and C:\Users\7057mehrav\Downloads\145-063-output\affine.err
-------------------------
command: c:\users\7057mehrav\appdata\local\continuum\anaconda3\envs\cellfinder2\lib\site-packages\imlib\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo C:\Users\7057mehrav\Downloads\145-063-output\brain_filtered.nii -ref C:\Users\7057mehrav\Downloads\145-063-output\downsampled_filtered.nii -aff C:\Users\7057mehrav\Downloads\145-063-output\affine_matrix.txt -res C:\Users\7057mehrav\Downloads\145-063-output\affine_registered_atlas_brain.nii -omp 44
-------------------------
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
Additional context I was given an Imaris file (.ims) that had the “z” dimension > 2048 (amap complained when I ran registration with the original file). So I cropped the z dimension and after cropping, the dimension of the imaris files were these:
This imaris file was then saved as a “series of TIFs” into a folder, which then became the input for amap.
Please let me know if I need to provide more details.
Thanks, Vatsal
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Re: brainrender, it’s all correct. Just notice that
brainrender.scene.add_image()
will be replaced in the future though methods to extract meshes from 3d images will still be part of brainrender.If you want to look at 3d images you can also use vtkplotter/vedo’s
Slicer()
So brainrender is typically used for visualisation of data in standard space, and not for single subject data. Theoretically you could do it, but it would be very hard to visualise the registration in 3D. The easiest way to visualise the registration results currently is to use
cellfinder_view
.If you want to visualise cells detected in cellfinder, there is a tool supplied to convert your
cells_in_standard_space.xml
into a format that brainrender can load (see here). In the future, cellfinder and brainrender will be better integrated.If you are interested in loading the
.nii
files from amap into python, you can use brainio to load them as numpy arrays:You can also load nii images directly into brainrender by using
brainrender.scene.add_image()
(which uses brainio). However, it will convert the image into a mesh, so you would just get a single “shape” to visualise.If you think there is anything that should be added to cellfinder/amap, please do submit a feature request as an issue. If you end up working something out yourself, let me know, as others might be able to make use of it.
Lastly, I’m ccing @fedeclaudi just in case I’ve said anything wrong about brainrender.