Brain registration

hi,Adam @adamltyson
there is an error when i use brainreg like follow:

2021-06-01 16:16:50 PM - INFO - MainProcess run.py:56 - Registering
2021-06-01 16:16:50 PM - INFO - MainProcess run.py:76 - Starting affine registration
Traceback (most recent call last):
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\imlib\general\system.py", line 281, in safe_execute_command
    subprocess.check_call(
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii -ref G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii -aff G:\ms20output_TIFF\output1\registration\niftyreg\affine_matrix.txt -res G:\ms20output_TIFF\output1\registration\niftyreg\affine_registered_atlas_brain.nii -omp 46' returned non-zero exit status 3221225477.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\backend\niftyreg\registration.py", line 73, in register_affine
    safe_execute_command(
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\imlib\general\system.py", line 293, in safe_execute_command
    raise SafeExecuteCommandError(
imlib.general.system.SafeExecuteCommandError:
-------------------------
Process failed:
 -------------------------
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin]
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin] Command line:
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin]
         c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii -ref G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii -aff G:\ms20output_TIFF\output1\registration\niftyreg\affine_matrix.txt -res G:\ms20output_TIFF\output1\registration\niftyreg\affine_registered_atlas_brain.nii -omp 46
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin]
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin] OpenMP is used with 46 thread(s)
[reg_aladin_sym] Parameters
[reg_aladin_sym] Platform: cpu_platform
[reg_aladin_sym] Reference image name: G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii
[reg_aladin_sym]        1742x1120x1489 voxels
[reg_aladin_sym]        0.01x0.01x0.01 mm
[reg_aladin_sym] Floating image name: G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii
[reg_aladin_sym]        1320x800x1140 voxels
[reg_aladin_sym]        0.01x0.01x0.01 mm
[reg_aladin_sym] Maximum iteration number: 5
[reg_aladin_sym]        (10 during the first level)
[reg_aladin_sym] Percentage of blocks: 50 %
[reg_aladin_sym] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-------------------------
please read the logs at G:\ms20output_TIFF\output1\registration\niftyreg\affine.log and G:\ms20output_TIFF\output1\registration\niftyreg\affine.err
-------------------------
command: c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii -ref G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii -aff G:\ms20output_TIFF\output1\registration\niftyreg\affine_matrix.txt -res G:\ms20output_TIFF\output1\registration\niftyreg\affine_registered_atlas_brain.nii -omp 46
-------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\CIBR-ImFacility-WS1\anaconda3\envs\cellfinder\Scripts\cellfinder.exe\__main__.py", line 7, in <module>
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\cellfinder\main.py", line 53, in main
    register(
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\main.py", line 65, in main
    run_niftyreg(
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\backend\niftyreg\run.py", line 77, in run_niftyreg
    brain_reg.register_affine()
  File "c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\backend\niftyreg\registration.py", line 79, in register_affine
    raise RegistrationError(
brainreg.backend.niftyreg.registration.RegistrationError: Affine registration failed;
-------------------------
Process failed:
 -------------------------
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin]
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin] Command line:
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin]
         c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii -ref G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii -aff G:\ms20output_TIFF\output1\registration\niftyreg\affine_matrix.txt -res G:\ms20output_TIFF\output1\registration\niftyreg\affine_registered_atlas_brain.nii -omp 46
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin]
[c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin] OpenMP is used with 46 thread(s)
[reg_aladin_sym] Parameters
[reg_aladin_sym] Platform: cpu_platform
[reg_aladin_sym] Reference image name: G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii
[reg_aladin_sym]        1742x1120x1489 voxels
[reg_aladin_sym]        0.01x0.01x0.01 mm
[reg_aladin_sym] Floating image name: G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii
[reg_aladin_sym]        1320x800x1140 voxels
[reg_aladin_sym]        0.01x0.01x0.01 mm
[reg_aladin_sym] Maximum iteration number: 5
[reg_aladin_sym]        (10 during the first level)
[reg_aladin_sym] Percentage of blocks: 50 %
[reg_aladin_sym] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-------------------------
please read the logs at G:\ms20output_TIFF\output1\registration\niftyreg\affine.log and G:\ms20output_TIFF\output1\registration\niftyreg\affine.err
-------------------------
command: c:\users\cibr-imfacility-ws1\anaconda3\envs\cellfinder\lib\site-packages\brainreg\bin\nifty_reg\win64\reg_aladin -ln 6 -lp 5 -flo G:\ms20output_TIFF\output1\registration\niftyreg\brain_filtered.nii -ref G:\ms20output_TIFF\output1\registration\niftyreg\downsampled_filtered.nii -aff G:\ms20output_TIFF\output1\registration\niftyreg\affine_matrix.txt -res G:\ms20output_TIFF\output1\registration\niftyreg\affine_registered_atlas_brain.nii -omp 46
-------------------------

@adamltyson hope for your answer~

and when i use --atlas allen_mouse_25um, the registration is ok.but it failed when i used the 10um resolution of allen brain atlas.

Does this happen on all your data, or just specific images? Could you upload the .err and .log files the error message mentions?

I guess the problem is with .err files.

this error just happened on the specific data.
affine.log.txt (1.7 KB)

but this .err files created during the affine proceedure, not the original files.

Could you upload affine.err?

the affine.err file type is not the right file type to upload.and this file is empty

Is there nothing in it all, even if you open it in a text editor (e.g. notepad)?

i`ve opened it by notepad.

In that case, I’m not sure what the problem is. Could you try reinstalling the software in a new conda environment?