BIC-MNI / minc-toolkit-v2

Version 2 of the minc-toolkit, uses tools based on ITK version 4.x
GNU General Public License v3.0
48 stars 21 forks source link

minctracc failed -11 #118

Closed charleygros closed 4 years ago

charleygros commented 4 years ago

My template generation pipeline (see here) has suddenly an unexpected behaviour, see below error.

Could you please provide me some guidance about where to start investigating? Much appreciated

ERROR: command ['minctracc', '/tmp/iplMincToolsYxsYMo/Gi9lHz3890_t1_blur_1.0_0.mnc', '/tmp/iplMincToolsYxsYMo/Gi9lHz3890_t1_blur_1.0_0.mnc', '-clobber', '-nonlinear', 'corrcoeff', '-weight', '1', '-stiffness', '1', '-similarity', '0.3', '-sub_lattice', '6', '-iterations', '10', '-lattice_diam', '3.0', '3.0', '0.0', '-step', '1.0', '1.0', '1.0', '-w_translations', '1', '1', '0', '-w_rotations', '0', '0', '0.0174533', '-w_scales', '0.02', '0.02', '0', '-w_shear', '0.02', '0.02', '0', '-no_super', '-identity', '-source_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '-model_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '/tmp/iplMincToolsYxsYMo/u9YQyJ3890_t1_3890_t1_7.xfm'] failed -11!
Message: 
Traceback (most recent call last):
  File "/home/GRAMES.POLYMTL.CA/chgroc/exvivo/sct/python/lib/python2.7/site-packages/scoop/_control.py", line 122, in runFuture
    uniqueReference = [cb.groupID for cb in future.callback][0]
IndexError: list index out of range
gdevenyi commented 4 years ago

We would need the actual output from minctracc to provide any feedback.

charleygros commented 4 years ago

We would need the actual output from minctracc to provide any feedback.

Thanks for your quick answer @gdevenyi . Really appreciated.

The command actually does not output any file. Would it be helpful if I share with you minctracc input files? If so, what would be the best way to do it?

gdevenyi commented 4 years ago

minctracc produces a fair amount of output. You appear to be using a python program which is not properly logging the output and presenting it to you. I suggest you try running the minctracc command manually to capture the output.

charleygros commented 4 years ago

You are very right! I tried to reproduce the error via terminal, here the output:

chgroc@joplin:/tmp$ minctracc save2/iplMincToolsOVinOI/y8WwZ33890_t1_blur_1.0_0.mnc save2/iplMincToolsOVinOI/y8WwZ33890_t1_blur_1.0_0.mnc -clobber -nonlinear corrcoeff -weight 1 -stiffness 1 -similarity 0.3 -sub_lattice 6 -no_super -identity -source_mask /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc -model_mask /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc 3g_m9E3890_t1_3890_t1_7.xfm
inside do_nonlinear: thresh:     0.0000     0.0000
Initializing deformation grid to 0...
Iteration  1 of  4
Segmentation fault (core dumped)
vfonov commented 4 years ago

check that masks are not empty and image voxels are not negative

gdevenyi commented 4 years ago

@vfonov beat me to it, but the next steps are to visualize/check all the input files to ensure they have the properties you expect. Beyond that, adding the "-debug" option will enhance the amount of output.

vfonov commented 4 years ago

also, in mincTools class there is an option to dump more information on the screen - i.e mincTools(verbose=2)

charleygros commented 4 years ago

The image voxels were indeed not all positive, because of a blur operation just before the minctracc. I tried to apply a "clamp" just after this blur command, something like, just here:

              minc.command(['mincmath', '-debug', '-clobber', '-clamp', '-const2', '100', '10000'], inputs=tmp_sources, outputs=tmp_sources)
              minc.command(['mincmath', '-debug', '-clobber', '-clamp', '-const2', '100', '10000'], inputs=tmp_targets, outputs=tmp_targets)

But I still get the same error. Here below the "debug" of minctracc:

Message: This run will use sub-lattice correlation (type 5) between the two input vols.
Source volume size: 1414  by 250  by 250 
Source voxel size =    0.080    0.080   -0.080
Source min/max real range =   -0.000 1635.125
Source min/max voxel=   -0.000 1635.125

Target volume size: 1414  by 250  by 250 
Target voxel =    0.080    0.080   -0.080
Target min/max real range=   -0.000 1635.125
Target min/max voxel =   -0.000 1635.125

AFTER init_params()
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 

Transform center   =    0.000    0.000    0.000
Transform rotations  =   -0.000   -0.000   -0.000
Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000
Transform shear    =    0.000    0.000    0.000

Target volume is smallest
Lattice step size  =   -1.000    1.000    1.000
Lattice start      =    9.460   -9.540  -56.356
Lattice count      =       19       20      113

The clamping I did may not be the best way to do it.. :/

vfonov commented 4 years ago

so, what happens when you open both input volumes in register - do they overlap?

charleygros commented 4 years ago

I am scared the problem comes from negative voxels: min value = -0.00020312500419095159 Are you able to see what's wrong with my clamping command?

              minc.command(['mincmath', '-debug', '-clobber', '-clamp', '-const2', '100', '10000'], inputs=tmp_sources, outputs=tmp_sources)
vfonov commented 4 years ago

so, negative voxels are not too big of the deal, as long as most voxels are positive. minctracc just ignores them in the computation.

charleygros commented 4 years ago

I would say that most voxels are closed to 0 or negative (background) while the foreground is centered around value=1000

charleygros commented 4 years ago

Here I get an error while source and target are the same file. I am going to looking deeper in this case

AT:[('/home/GRAMES.POLYMTL.CA/chgroc/exvivo/sct/python/lib/python2.7/site-packages/scoop/_control.py', 127, 'runFuture', 'future.resultValue = future.callable(*future.args, **future.kargs)'), ('/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/model/registration.py', 241, 'non_linear_register_step', 'downsample=downsample,'), ('/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/registration.py', 792, 'non_linear_register_full', 'outputs=[tmp_xfm] )'), ('/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/minc_tools.py', 419, 'command', 'raise mincError("ERROR: command {} failed {}!\\nMessage: {}\\n{}".format(str(cmds),str(outvalue),output_stderr,traceback.format_exc()))'), ('/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/minc_tools.py', 64, '__init__', 'self.stack = traceback.extract_stack()')]
Traceback (most recent call last):
  File "/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/model/registration.py", line 241, in non_linear_register_step
    downsample=downsample,
  File "/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/registration.py", line 792, in non_linear_register_full
    outputs=[tmp_xfm] )
  File "/home/GRAMES.POLYMTL.CA/chgroc/exvivo/nist_mni_pipelines/ipl/minc_tools.py", line 419, in command
    raise mincError("ERROR: command {} failed {}!\nMessage: {}\n{}".format(str(cmds),str(outvalue),output_stderr,traceback.format_exc()))
mincError: mincError:ERROR: command ['minctracc', '/tmp/iplMincToolsdwrIa8/UyejYu3890_t1_blur_1.0_0.mnc', '/tmp/iplMincToolsdwrIa8/UyejYu3890_t1_blur_1.0_0.mnc', '-clobber', '-debug', '-nonlinear', 'corrcoeff', '-weight', '1', '-stiffness', '1', '-similarity', '0.3', '-sub_lattice', '6', '-iterations', '10', '-lattice_diam', '3.0', '3.0', '0.0', '-step', '1.0', '1.0', '1.0', '-w_translations', '1', '1', '0', '-w_rotations', '0', '0', '0.0174533', '-w_scales', '0.02', '0.02', '0', '-w_shear', '0.02', '0.02', '0', '-no_super', '-identity', '-source_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '-model_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '/tmp/iplMincToolsdwrIa8/r0y9U_3890_t1_3890_t1_7.xfm'] failed -11!
Message: This run will use sub-lattice correlation (type 5) between the two input vols.
Source volume size: 1414  by 250  by 250 
Source voxel size =    0.080    0.080   -0.080
Source min/max real range =   -0.000 1635.125
Source min/max voxel=   -0.000 1635.125

Target volume size: 1414  by 250  by 250 
Target voxel =    0.080    0.080   -0.080
Target min/max real range=   -0.000 1635.125
Target min/max voxel =   -0.000 1635.125

AFTER init_params()
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 

Transform center   =    0.000    0.000    0.000
Transform rotations  =   -0.000   -0.000   -0.000
Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000
Transform shear    =    0.000    0.000    0.000

Target volume is smallest
Lattice step size  =   -1.000    1.000    1.000
Lattice start      =    9.460   -9.540  -56.356
Lattice count      =       19       20      113

Traceback (most recent call last):
  File "/home/GRAMES.POLYMTL.CA/chgroc/exvivo/sct/python/lib/python2.7/site-packages/scoop/_control.py", line 122, in runFuture
    uniqueReference = [cb.groupID for cb in future.callback][0]
IndexError: list index out of range
gdevenyi commented 4 years ago

I would like to see some visualizations, with register, of input files and the masks.

charleygros commented 4 years ago

The masks are very basic cylinder surrounding the Spinal Cord: Screenshot from 2020-07-03 10-14-48

The image before the pipeline looks something like that: Screenshot from 2020-07-03 10-15-22

However, I am not able to visualize the direct input of the minctracc (ie output of the blur) as I receive this message from fsleyes. Likely to be linked to my issue :/ Screenshot from 2020-07-03 10-15-44

Have you ever encountered such issue?

charleygros commented 4 years ago

I am happy to share with you the files if it helps somehow.

gdevenyi commented 4 years ago

Can you please use register to load all files simultaneously.

In addition, please include/check the input to the blur.

charleygros commented 4 years ago

Blur:

['fast_blur', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3890_t1.mnc', '/tmp/iplMincTools1FIPhs/LzAv7y3890_t1_blur_1.0_0.mnc', '--fwhm', '1.0']

minctracc:

['minctracc', '/tmp/iplMincTools1FIPhs/LzAv7y3890_t1_blur_1.0_0.mnc', '/tmp/iplMincTools1FIPhs/LzAv7y3890_t1_blur_1.0_0.mnc', '-clobber', '-debug', '-nonlinear', 'corrcoeff', '-weight', 1, '-stiffness', 1, '-similarity', 0.3, '-sub_lattice', 6, '-iterations', 10, '-lattice_diam', 3.0, 3.0, 0.0, '-step', 1.0, 1.0, 1.0, '-w_translations', 1, 1, 0, '-w_rotations', 0, 0, 0.0174533, '-w_scales', 0.02, 0.02, 0, '-w_shear', 0.02, 0.02, 0, '-no_super', '-identity', '-source_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '-model_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '/tmp/iplMincTools1FIPhs/ARnEIg3890_t1_3890_t1_7.xfm']

Leading to the error:

ERROR: command ['minctracc', '/tmp/iplMincTools1FIPhs/LzAv7y3890_t1_blur_1.0_0.mnc', '/tmp/iplMincTools1FIPhs/LzAv7y3890_t1_blur_1.0_0.mnc', '-clobber', '-debug', '-nonlinear', 'corrcoeff', '-weight', '1', '-stiffness', '1', '-similarity', '0.3', '-sub_lattice', '6', '-iterations', '10', '-lattice_diam', '3.0', '3.0', '0.0', '-step', '1.0', '1.0', '1.0', '-w_translations', '1', '1', '0', '-w_rotations', '0', '0', '0.0174533', '-w_scales', '0.02', '0.02', '0', '-w_shear', '0.02', '0.02', '0', '-no_super', '-identity', '-source_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '-model_mask', '/home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/template_mask.mnc', '/tmp/iplMincTools1FIPhs/ARnEIg3890_t1_3890_t1_7.xfm'] failed -11!
Message: This run will use sub-lattice correlation (type 5) between the two input vols.
Source volume size: 1414  by 250  by 250 
Source voxel size =    0.080    0.080   -0.080
Source min/max real range =   -0.000 1635.125
Source min/max voxel=   -0.000 1635.125

Target volume size: 1414  by 250  by 250 
Target voxel =    0.080    0.080   -0.080
Target min/max real range=   -0.000 1635.125
Target min/max voxel =   -0.000 1635.125

AFTER init_params()
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 

Transform center   =    0.000    0.000    0.000
Transform rotations  =   -0.000   -0.000   -0.000
Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000
Transform shear    =    0.000    0.000    0.000

Target volume is smallest
Lattice step size  =   -1.000    1.000    1.000
Lattice start      =    7.460   -7.540  -56.356
Lattice count      =       16       16      113

These three files in register: output of blur=input of minctracc // input of blur // mask: Screenshot from 2020-07-03 21-46-21

vfonov commented 4 years ago

so, to understand what you are trying to archive: it's nonlinear coregistration of two spinal cords scanned at 0.08mm^3 resolution, blurred with 1mm fwhm Gaussian kernel? And there are some weights for rotations, translations and scales?

gdevenyi commented 4 years ago

So, I'm a bit confused. Your call to minctracc is using the same file for moving and fixed image, and you're using the same mask twice. What exactly is the goal of this?

Regarding the negative values, you should be clamping the image before the blur, rather than after, as I see the original image has a very large (-1000) negative range.

gdevenyi commented 4 years ago

And one more question, I don't actually see the complete output of a minctracc call with -debug.

Can you just copy+paste+edit the python call (add -debug) and run it straight on the command line and provide the complete output?

charleygros commented 4 years ago

so, to understand what you are trying to archive: it's nonlinear coregistration of two spinal cords scanned at 0.08mm^3 resolution, blurred with 1mm fwhm Gaussian kernel? And there are some weights for rotations, translations and scales?

Yes, correct! Here below the command that raises a Segmentation Fault, weights for rotations, translations, scales are indicated:

chgroc@joplin:/tmp/save4/iplMincToolsP_9eJN$ minctracc V7e7w83944_t1_blur_1.0_0.mnc 4Sj2Yv3890_t1_blur_1.0_0.mnc -clobber -debug -nonlinear corrcoeff -weight 1 -stiffness 1 -similarity 0.3 -sub_lattice 6 -iterations 10 -lattice_diam 3.0 3.0 0.0 -step 1.0 1.0 1.0 -w_translations 1 1 0 -w_rotations 0 0 0.0174533 -w_scales 0.02 0.02 0 -w_shear 0.02 0.02 0 -no_super -identity -source_mask /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3944_t1_mask.mnc -model_mask /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3890_t1_mask.mnc /tmp/iplMincToolsP_9eJN/JyA6I73944_t1_3890_t1_7.xfm

Command line output in debug mode:

===== Debugging information from minctracc =====
Data filename       = V7e7w83944_t1_blur_1.0_0.mnc
Model filename      = 4Sj2Yv3890_t1_blur_1.0_0.mnc
Data mask filename  = /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3944_t1_mask.mnc
Model mask filename = /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3890_t1_mask.mnc
Input xform name    = 
Output filename     = /tmp/iplMincToolsP_9eJN/JyA6I73944_t1_3890_t1_7.xfm
Step size           = 1.000000 1.000000 1.000000
Sub-lattice dia     = 3.000000 3.000000 0.000000
Objective function  = cross correlation (threshold = 0.000000 0.000000)
Transform linear    = TRUE
Transform inverted? = FALSE
Transform type      = 9
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 
Transform center   =    0.000    0.000    0.000
Transform rotation   =    0.000    0.000    0.000 

Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000

This run will use sub-lattice correlation (type 5) between the two input vols.
Source volume size: 1414  by 250  by 250 
Source voxel size =    0.080    0.080   -0.080
Source min/max real range =   -0.000 1585.093
Source min/max voxel=   -0.000 1585.093

Target volume size: 1414  by 250  by 250 
Target voxel =    0.080    0.080   -0.080
Target min/max real range=   -0.000 1635.125
Target min/max voxel =   -0.000 1635.125

  using input transformation to get initial parameters:
   Center of rot/scale not forced, will be set to : 0.000000 0.000000 0.000000
AFTER init_params()
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 

Transform center   =    0.000    0.000    0.000
Transform rotations  =   -0.000   -0.000   -0.000
Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000
Transform shear    =    0.000    0.000    0.000

In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
slice lim 35 111
row lim   5 13
col lim   5 16
thresh =    0.00000    0.00000
In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
Target volume is smallest
Lattice step size  =   -1.000    1.000    1.000
Lattice start      =    7.460   -4.540  -22.356
Lattice count      =       16       10       77

In append_new_default_deformation_field...
in append new def, the start is:    7.460   -4.540  -22.356
in append_new_default_deformation_field:
    count_extended= 3 82 15 21
 point:    9.960   -7.040  -24.856 
 start:    9.960   -7.040  -24.856 
 wstrt:    9.960   -7.040  -24.856 
 voxel:    0.000    0.000    0.000 
 dirs:    1.000    0.000   -0.000 
 dirs:   -0.000    1.000    0.000 
 dirs:    0.000   -0.000    1.000 
There are 1 feature pairs
0: [5] [1.00000] V7e7w83944_t1_blur_1.0_0.mnc <-> 4Sj2Yv3890_t1_blur_1.0_0.mnc
A sub-lattice is needed for at least one feature
Sub-lattice dia     = 3.000000 3.000000 0.000000
orig transform is 2 long
all_until_last is 1 long
inside do_nonlinear: thresh:     0.0000     0.0000
   6015    5036 -> 0.15737699

Debug info from do_nonlinear_optimization---------------
Initial corr         = 0.157377
Source vol threshold = 0.000000
Target vol threshold = 0.000000
Iteration limit      = 10
Iteration weight     = 1.000000
xyzv                 =   3   2   1   0 
number_dimensions    = 3
num_of_dims_to_opt   = 3
smoothing_weight     = 1.000000
loop                 = (1 20) (1 14) (1 81)
current_def_vector   = 0.000000 0.000000 0.000000

Fitting STRATEGY ----------
  This fit will use local simplex optimization and
  Simplex radius =   12.50 (voxels) or    1.00(mm)
    global smoothing.
  The similarity function will be evaluated using tri-linear interpolation
    on a ellipsoidal sub-lattice with a radii of
    6 nodes across the diameter
      37.50,  37.50,  -0.00  (data voxels),
       3.00    3.00    0.00 (mm) width 
       7.50    7.50   -0.00 (data voxels) per node 
       0.60    0.60    0.00 (mm) per node 
-----------------------
Initializing deformation grid to 0...
Iteration  1 of 10
Segmentation fault (core dumped)

I am about to post the register screenshot of these files.

charleygros commented 4 years ago

So, I'm a bit confused. Your call to minctracc is using the same file for moving and fixed image, and you're using the same mask twice. What exactly is the goal of this?

Regarding the negative values, you should be clamping the image before the blur, rather than after, as I see the original image has a very large (-1000) negative range.

Yep, sorry, that was not a very realistic example. Here above a better one: two blurred images, with their respective binary masks.

charleygros commented 4 years ago

register visualization related to this command.

image

gdevenyi commented 4 years ago

Okay. I finally have enough info to be reasonably confident that the input files are not horribly broken.

Can you please provide full details of: 1) The type of system this is running on (OS, memory, CPU etc) 2) What version of minc-toolkit-v2 is installed 3) How minc-toolkit-v2 was installed

And finally, can you copy these files to a different system with minc-toolkit-v2 installed and attempt to reproduce the problem there, to attempt to rule out issues with 1-3 above.

vfonov commented 4 years ago

i would say - try running it without weights parameters , just straight nonlinear registration.

charleygros commented 4 years ago

Okay. I finally have enough info to be reasonably confident that the input files are not horribly broken.

Apologies. And thank you very much for your help.

charleygros commented 4 years ago

i would say - try running it without weights parameters , just straight nonlinear registration.

Without wieghts parameters:

minctracc V7e7w83944_t1_blur_1.0_0.mnc 4Sj2Yv3890_t1_blur_1.0_0.mnc -clobber -debug -nonlinear corrcoeff -iterations 10 -no_super -identity -source_mask /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3944_t1_mask.mnc -model_mask /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3890_t1_mask.mnc /tmp/iplMincToolsP_9eJN/JyA6I73944_t1_3890_t1_7.xfm

Gives:

===== Debugging information from minctracc =====
Data filename       = V7e7w83944_t1_blur_1.0_0.mnc
Model filename      = 4Sj2Yv3890_t1_blur_1.0_0.mnc
Data mask filename  = /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3944_t1_mask.mnc
Model mask filename = /home/GRAMES.POLYMTL.CA/chgroc/data_nvme_chgroc/template_midLvl/3890_t1_mask.mnc
Input xform name    = 
Output filename     = /tmp/iplMincToolsP_9eJN/JyA6I73944_t1_3890_t1_7.xfm
Step size           = 4.000000 4.000000 4.000000
Sub-lattice dia     = 24.000000 24.000000 24.000000
Objective function  = cross correlation (threshold = 0.000000 0.000000)
Transform linear    = TRUE
Transform inverted? = FALSE
Transform type      = 9
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 
Transform center   =    0.000    0.000    0.000
Transform rotation   =    0.000    0.000    0.000 

Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000

This run will use sub-lattice correlation (type 5) between the two input vols.
Source volume size: 1414  by 250  by 250 
Source voxel size =    0.080    0.080   -0.080
Source min/max real range =   -0.000 1585.093
Source min/max voxel=   -0.000 1585.093

Target volume size: 1414  by 250  by 250 
Target voxel =    0.080    0.080   -0.080
Target min/max real range=   -0.000 1635.125
Target min/max voxel =   -0.000 1635.125

  using input transformation to get initial parameters:
   Center of rot/scale not forced, will be set to : 0.000000 0.000000 0.000000
AFTER init_params()
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 

Transform center   =    0.000    0.000    0.000
Transform rotations  =   -0.000   -0.000   -0.000
Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000
Transform shear    =    0.000    0.000    0.000

In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
slice lim 9 27
row lim   1 3
col lim   2 4
thresh =    0.00000    0.00000
In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
Target volume is smallest
Lattice step size  =   -4.000    4.000    4.000
Lattice start      =    7.960   -4.040  -22.356
Lattice count      =        4        3       20

In append_new_default_deformation_field...
in append new def, the start is:    7.960   -4.040  -22.356
in append_new_default_deformation_field:
    count_extended= 3 25 8 9
 point:   17.960  -14.040  -32.356 
 start:   17.960  -14.040  -32.356 
 wstrt:   17.960  -14.040  -32.356 
 voxel:    0.000    0.000    0.000 
 dirs:    1.000    0.000   -0.000 
 dirs:   -0.000    1.000    0.000 
 dirs:    0.000   -0.000    1.000 
There are 1 feature pairs
0: [5] [1.00000] V7e7w83944_t1_blur_1.0_0.mnc <-> 4Sj2Yv3890_t1_blur_1.0_0.mnc
A sub-lattice is needed for at least one feature
Sub-lattice dia     = 24.000000 24.000000 24.000000
orig transform is 2 long
all_until_last is 1 long
inside do_nonlinear: thresh:     0.0000     0.0000
     87      72 -> 0.13299185

Debug info from do_nonlinear_optimization---------------
Initial corr         = 0.132992
Source vol threshold = 0.000000
Target vol threshold = 0.000000
Iteration limit      = 10
Iteration weight     = 0.600000
xyzv                 =   3   2   1   0 
number_dimensions    = 3
num_of_dims_to_opt   = 3
smoothing_weight     = 0.500000
loop                 = (1 8) (1 7) (1 24)
current_def_vector   = 0.000000 0.000000 0.000000

Fitting STRATEGY ----------
  This fit will use local simplex optimization and
  Simplex radius =   50.00 (voxels) or    4.00(mm)
    global smoothing.
  The similarity function will be evaluated using tri-linear interpolation
    on a ellipsoidal sub-lattice with a radii of
    5 nodes across the diameter
     300.00, 300.00,-300.00  (data voxels),
      24.00   24.00   24.00 (mm) width 
      75.00   75.00  -75.00 (data voxels) per node 
       6.00    6.00    6.00 (mm) per node 
-----------------------
Initializing deformation grid to 0...
Iteration  1 of 10
Segmentation fault (core dumped)
charleygros commented 4 years ago
1. The type of system this is running on (OS, memory, CPU etc)

Ubuntu 18.04.4 LTS

              total        used        free      shared  buff/cache   available
Mem:         257809        1794       92483           4      163531      253771
Swap:           975          37         938

64-core CPU image

2. What version of minc-toolkit-v2 is installed

1.9.16

3. How minc-toolkit-v2 was installed

Following these guidelines. Also: broader project guidelines. But not sure if it answers correctly your question.

Note that these commands were working perfectly few months ago on the same station.

charleygros commented 4 years ago

Same command on another station:

===== Debugging information from minctracc =====
Data filename       = V7e7w83944_t1_blur_1.0_0.mnc
Model filename      = 4Sj2Yv3890_t1_blur_1.0_0.mnc
Data mask filename  = 3944_t1_mask.mnc
Model mask filename = 3890_t1_mask.mnc
Input xform name    = 
Output filename     = JyA6I73944_t1_3890_t1_7.xfm
Step size           = 4.000000 4.000000 4.000000
Sub-lattice dia     = 24.000000 24.000000 24.000000
Objective function  = cross correlation (threshold = 0.000000 0.000000)
Transform linear    = TRUE
Transform inverted? = FALSE
Transform type      = 9
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 
Transform center   =    0.000    0.000    0.000
Transform rotation   =    0.000    0.000    0.000 

Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000

This run will use sub-lattice correlation (type 5) between the two input vols.
Source volume size: 1414  by 250  by 250 
Source voxel size =    0.080    0.080   -0.080
Source min/max real range =   -0.000 1585.093
Source min/max voxel=   -0.000 1585.093

Target volume size: 1414  by 250  by 250 
Target voxel =    0.080    0.080   -0.080
Target min/max real range=   -0.000 1635.125
Target min/max voxel =   -0.000 1635.125

  using input transformation to get initial parameters:
   Center of rot/scale not forced, will be set to : 0.000000 0.000000 0.000000
AFTER init_params()
Transform matrix    =    1.0000    0.0000    0.0000    0.0000 
                         0.0000    1.0000    0.0000    0.0000 
                         0.0000    0.0000    1.0000    0.0000 

Transform center   =    0.000    0.000    0.000
Transform rotations  =   -0.000   -0.000   -0.000
Transform trans    =    0.000    0.000    0.000
Transform scale    =    1.000    1.000    1.000
Transform shear    =    0.000    0.000    0.000

In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
slice lim 9 27
row lim   1 3
col lim   2 4
thresh =    0.00000    0.00000
In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
Target volume is smallest
Lattice step size  =   -4.000    4.000    4.000
Lattice start      =    7.960   -4.040  -22.356
Lattice count      =        4        3       20

In append_new_default_deformation_field...
in append new def, the start is:    7.960   -4.040  -22.356
in append_new_default_deformation_field:
    count_extended= 3 25 8 9
 point:   17.960  -14.040  -32.356 
 start:   17.960  -14.040  -32.356 
 wstrt:   17.960  -14.040  -32.356 
 voxel:    0.000    0.000    0.000 
 dirs:    1.000    0.000   -0.000 
 dirs:   -0.000    1.000    0.000 
 dirs:    0.000   -0.000    1.000 
There are 1 feature pairs
0: [5] [1.00000] V7e7w83944_t1_blur_1.0_0.mnc <-> 4Sj2Yv3890_t1_blur_1.0_0.mnc
A sub-lattice is needed for at least one feature
Sub-lattice dia     = 24.000000 24.000000 24.000000
orig transform is 2 long
all_until_last is 1 long
inside do_nonlinear: thresh:     0.0000     0.0000
     87      72 -> 0.13299185

Debug info from do_nonlinear_optimization---------------
Initial corr         = 0.132992
Source vol threshold = 0.000000
Target vol threshold = 0.000000
Iteration limit      = 10
Iteration weight     = 0.600000
xyzv                 =   3   2   1   0 
number_dimensions    = 3
num_of_dims_to_opt   = 3
smoothing_weight     = 0.500000
loop                 = (1 8) (1 7) (1 24)
current_def_vector   = 0.000000 0.000000 0.000000

Fitting STRATEGY ----------
  This fit will use local simplex optimization and
  Simplex radius =   50.00 (voxels) or    4.00(mm)
    global smoothing.
  The similarity function will be evaluated using tri-linear interpolation
    on a ellipsoidal sub-lattice with a radii of
    5 nodes across the diameter
     300.00, 300.00,-300.00  (data voxels),
      24.00   24.00   24.00 (mm) width 
      75.00   75.00  -75.00 (data voxels) per node 
       6.00    6.00    6.00 (mm) per node 
-----------------------
Initializing deformation grid to 0...
Iteration  1 of 10
Segmentation fault (core dumped)

1. System Ubuntu 16.04.6 LTS

              total        used        free      shared  buff/cache   available
Mem:          64324         934       56956          33        6433       62463
Swap:         65436           0       65436

12-core CPU

2. Minc version:

chgroc@bireli:~$ mincinfo -version
program: 1.5.1
libminc: 1.5.1
netcdf : 3.6.0-p1 of Jun 18 2015 18:10:35 $

3. Installation: I am not exactly sure how it has been installed on this station, it was not me who did it. I ve sent an email to figure it out.

vfonov commented 4 years ago

1.5.1 minc is very very old (~ 2006).

charleygros commented 4 years ago

I can update minc. Before I do so, I was hoping to find a way to reproduce my results of few months ago with this environment. Can you think of anything I could try? Otherwise I will update my minc and re try.

charleygros commented 4 years ago

Well, thank you both of you :-)