[MINC-users] [minctracc] segfault when using -measure option

Robert D. Vincent robert.d.vincent at mcgill.ca
Sun Sep 25 09:01:50 EDT 2016


Hi again,

So I have a couple of clues about the possible problem. It appears that
minctracc can misbehave for some files with negative steps. Can you try the
following with your example:

mincreshape -valid_range 0 4095 +xdirection +ydirection +zdirection t1p.mnc
t1c.mnc

and re-run minctracc with t1c.mnc instead of t1p.mnc. Let me know if this
still produces a segfault. It seems to fix it for me.

    -bert

On Sun, Sep 25, 2016 at 7:28 AM, Robert D. Vincent <
robert.d.vincent at mcgill.ca> wrote:

> Thanks for the example, I'll look into it.
>
>
> On Sun, Sep 25, 2016 at 4:13 AM, Mishkin Derakhshan <mishkind at gmail.com>
> wrote:
>
>> Hi,
>> I get a segfault whenever I try to use the -measure option.
>> Here is the simplest example to reproduce the bug.
>>
>> $ minctracc -measure out.txt t1p.mnc.gz t1p.mnc.gz -transformation
>> identity.xfm
>>
>> I'm using:
>> $ minctracc -version
>> The program <minctracc> was built from:
>> mni_autoreg 0.99.60
>>
>> Here is some info on the files, but I don't think it has to do with the
>> files themselves as I've tried 100s. Maybe someone else can confirm.
>> $ mincinfo t1p.mnc.gz
>> file: t1p.mnc.gz
>> image: signed__ short 0 to 4095
>> image dimensions: zspace yspace xspace
>>     dimension name         length         step        start
>>     --------------         ------         ----        -----
>>     zspace                     60            3     -93.0427
>>     yspace                    256    -0.976562      119.239
>>     xspace                    192    -0.976562      91.5716
>>
>> $ cat identity.xfm
>> MNI Transform File
>> %Sun Sep 25 03:59:15 2016>>> param2xfm -scale 1 1 1 identity.xfm
>> %(mni_autoreg 0.99.60)
>>
>> Transform_Type = Linear;
>> Linear_Transform =
>>  1 0 0 0
>>  0 1 0 0
>>  0 0 1 0;
>>
>> Looking at the print statements in the debug output from minctracc, and
>> comparing with minctracc/Main/measure_code.c I have a rough idea where the
>> segfault must be happening, but it's a little outside my depth at this
>> point.
>>
>> Bug happens somewhere in here:
>>                             /* do var_ratio */
>>
>>     main_args.obj_function = vr_objective;
>>     obj_func_val = measure_fit( data, model, mask_data, mask_model,
>> &main_args );
>>     (void)fprintf (ofd, "%f - var_ratio\n",obj_func_val);
>>     (void)fflush(ofd);
>>     DEBUG_PRINT1 ( "%f - var_ratio\n",obj_func_val);
>>
>>     delete_volume(data);
>>     delete_volume(model);
>>
>>                                 /* do ssc / zero-crossings */
>>
>>     status = input_volume( main_args.filenames.data, 3, default_dim_names,
>>                           NC_UNSPECIFIED, FALSE, 0.0, 0.0,
>>                           TRUE, &data, (minc_input_options *)NULL );
>>     status = input_volume( main_args.filenames.model, 3,
>> default_dim_names,
>>                           NC_UNSPECIFIED, FALSE, 0.0, 0.0,
>>                           TRUE, &model, (minc_input_options *)NULL );
>>
>>     main_args.obj_function = ssc_objective;
>>     obj_func_val = measure_fit( data, model, mask_data, mask_model,
>> &main_args );
>>     (void)fprintf (ofd, "%f - ssc\n",obj_func_val);
>>     (void)fflush(ofd);
>>     DEBUG_PRINT1 ( "%f - ssc\n",obj_func_val);
>>
>>
>> The good news is that the out.txt measure file still gets output, albeit
>> incomplete, but so does a large core file. Not to mention I can't sleep at
>> night having a seg fault that is built into the pipeline, er, at least one
>> that that I know about!
>>
>> any help?
>> mishkin
>>
>> Here is the debugging output from minctracc if that helps:
>>
>> $ minctracc -measure out.txt t1p.mnc.gz t1p.mnc.gz -transformation
>> identity.xfm -debug
>> ===== Debugging information from minctracc =====
>> Data filename       = t1p.mnc.gz
>> Model filename      = t1p.mnc.gz
>> Data mask filename  =
>> Model mask filename =
>> Input xform name    = identity.xfm
>> Measure filename    = out.txt
>>
>> 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      = 4
>> 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
>>
>> Source volume size:  60  by 256  by 192
>> Source voxel size =    3.000   -0.977   -0.977
>> Source min/max real range =    0.000 2083.000
>> Source min/max voxel=    0.000 2083.000
>>
>> Target volume size:  60  by 256  by 192
>> Target voxel =    3.000   -0.977   -0.977
>> Target min/max real range=    0.000 2083.000
>> Target min/max voxel =    0.000 2083.000
>>
>>
>>   using input transformation to get initial parameters:
>>    Center of rot/scale not forced, will be set to : 0.000000 0.000000
>> 0.000000
>> In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
>> slice lim 0 44
>> row lim   1 62
>> col lim   1 46
>> thresh =    0.00000    0.00000
>> In set_up_lattice, xyzv[axes] = 2, 1, 0, -1
>> Source volume is smallest
>> Lattice step size  =   -4.000   -4.000    4.000
>> Lattice start      =   88.104  129.917  -72.203
>> Lattice count      =       46       62       45
>>
>>  128340  128340  128340 ->        inf
>> inf - zscore
>>  128340  128340 -> 0.00000000
>> 0.000000 - xcorr
>>  128340  128340       0 -> 0.20877945
>> 0.208779 - var_ratio
>> Segmentation fault
>> _______________________________________________
>> MINC-users at bic.mni.mcgill.ca
>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>>
>
>


More information about the MINC-users mailing list