Open vfonov opened 7 years ago
This part has to be changed to something sane: https://github.com/BIC-MNI/minc-tools/blob/develop/progs/mincreshape/mincreshape.c#L1585-L1590
What is the state of the zspace dimension variable in the original file? Does it contain a vector of spacings?
yes, it does - see above.
The code you cite is the way it is because I've had requests to preserve the vector of sample points along the dimension even when the overall spacing is regular. However, micreate_std_variable() automatically sets "irregular" spacing if the number of variable dimensions is > 0. I'd say it would be correct to override that in mincreshape by setting the spacing correctly after the step and start are set.
It might be worth adding code to correctly fill out the contents of zspace , when mincreshape is extending FOV:
./minctools/progs/mincreshape -dimrange zspace=-10,20 PreventAD_424640_lego_phantom_MTL_20160621_greT2star_001.mnc test.mnc
mincinfo -varvalues zspace test.mnc
0 0 0 0 0 0 0 0 0 0 -60.799999237061001622 -58.799999237061001622 -56.799999237061001622 -54.799999237061001622 -52.799999237061001622 -50.799999237061001622 -48.799999237061001622 -46.799999237061001622 -44.799999237061001622 -42.799999237061001622
Test:
mincinfo -attvalue zspace:spacing PreventAD_424640_lego_phantom_MTL_20160621_greT2star_001.mnc
regular__
mincreshape -dimrange zspace=0,10 PreventAD_424640_lego_phantom_MTL_20160621_greT2star_001.mnc test.mnc
mincinfo -attvalue zspace:spacing test.mnc
irregular
mincinfo -varvalues zspace PreventAD_424640_lego_phantom_MTL_20160621_greT2star_001.mnc
-60.799999237061001622 .... 41.200000762938998378