question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] amap registration: reg_aladin.exe has stopped working

See original GitHub issue

Describe 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 image

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:

image

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:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
FedeClaudicommented, Jun 17, 2020

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()

1reaction
adamltysoncommented, Jun 17, 2020

Is there any documentation on the output files that amap registration results in? I want to visualize this registration data (along with marked cells) using Brainrender.

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:

from brainio import brainio
image = brainio.load_any("image_file.nii")

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RegistrationWizard.exe has stopped working - NI Community
Solved: I recently reinstalled LabVIEW 2011, and I am having a problem with the Registration Wizard. It keeps crashing at startup, ...
Read more >
How to fix "explorer.exe Class not Registered ... - YouTube
How to fix "explorer. exe Class not Registered " Error in Windows 10 (2021). 100K views 1 year ago.
Read more >
Untitled
The SVF file is used to account for name changes that occur during syn- thesis as a result of running commands such as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found