Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vfonov opened this issue Nov 1, 2016 · 5 comments

Comments

@vfonov
Copy link
Member

vfonov commented Nov 1, 2016

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

@vfonov
Copy link
Member Author

vfonov commented Nov 1, 2016

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
Copy link
Member

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

@vfonov
Copy link
Member Author

vfonov commented Nov 1, 2016

yes, it does - see above.

@rdvincent
Copy link
Member

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
Copy link
Member Author

vfonov commented Nov 1, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants