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

mhd_write failing with out in-house atlas.mhd images #11

Open
raacampbell opened this issue Nov 19, 2015 · 3 comments
Open

mhd_write failing with out in-house atlas.mhd images #11

raacampbell opened this issue Nov 19, 2015 · 3 comments
Assignees
Labels

Comments

@raacampbell
Copy link
Owner

looks like an integer overflow is happening

@raacampbell raacampbell self-assigned this Nov 19, 2015
@raacampbell
Copy link
Owner Author

Hmmm.. Reading seems to work correctly

>> Aorig = mhd_read('~/atlas.mhd');

Then I can save and re-read an the results are the same:

>> mhd_write(Aorig,'atlas_write')
>> Areadwritten  = mhd_read('atlas_write.mhd');
>> all(Aorig(:) == Areadwritten(:))
ans =

     1

And atlas_write looks fine in Lasagna. In MATLAB these are int32 files and they are ints in the MHD.

However, if I run the in-house function atlasInSampleSpace (which returns the transformed atlas [via transformix] to the workspace) then I get an int16 and things fuck up from there.

@raacampbell
Copy link
Owner Author

Ah, shit, it's transformix that's fucking this up:

$ transformix -in atlas.mhd  -tp TransformParameters.1.txt -out ./

The result is toast. transformix is saving it as shorts even though the input mhd is listed as unit.

@raacampbell
Copy link
Owner Author

Things that seem to fix this:

(FinalBSplineInterpolationOrder 0)
(ResultImagePixelType "int")

The first stops it interpolating.
The second is needed because the parameters were calculated with the template images, which are shorts.

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

No branches or pull requests

1 participant