[MINC-users] dcm2mnc and (ir)regular spacing (again)

Alex Zijdenbos zijdenbos at gmail.com
Wed Apr 18 13:41:19 EDT 2012


On Wed, Apr 18, 2012 at 9:41 AM, Peter Neelin <peter.neelin at gmail.com> wrote:
> Hi Alex,
>
> On Tue, Apr 17, 2012 at 5:10 PM, Alex Zijdenbos <zijdenbos at gmail.com> wrote:
>
>> So time:spacing is listed as "irregular"; and looking at the time- and
>> time-width vars the frame times are 300s apart (give or take).
>> However, the time:step attribute is 225, not 300.
>>
>> Is this basically broken MINC?
>
> Yes, it is broken. The step should be some form of average.
>
>> I assume the time:step attribute
>> somehow is generated from some DICOM field, but is basically wrong?
>
> No, it is computed. The broken code is in dcm2mnc/minc_file.c, in
> function minc_set_spacing(). It appears that the code is going down
> the "if (regular)" branch and incorrectly computing the step by
> summing the difference between coordinates for N-1 values, then
> dividing by N (line 532). It then calls check_regular to see if it is
> regular and finds that the (wrong) step value does not match the
> coordinate spacing and marks the spacing as irregular.

OK I see - thanks! So that line 532 should divide by N-1 (I filed an
issue on github). Seems like all along this could have resulted in
wrong step sizes in many MINC volumes generated by dcm2mnc...

-- A


More information about the MINC-users mailing list