BIC-MNI / minc-tools

Basic minc-tools from former minc repository
Other
30 stars 25 forks source link

mincreshape changes dimension spacing from regular to irregular, when space has coordinates associated with it #56

Open vfonov opened 7 years ago

vfonov commented 7 years ago

Test:

vfonov commented 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

rdvincent commented 7 years ago

What is the state of the zspace dimension variable in the original file? Does it contain a vector of spacings?

vfonov commented 7 years ago

yes, it does - see above.

rdvincent commented 7 years ago

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.

vfonov commented 7 years ago

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