Transpose images when reading/writing images #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While going back and forth between Julia and an external dicom viewer, I've noticed that the images are always transposed in Julia.
This is likely because Julia's arrays are column-major while dicom's pixel arrays are row-major.
The solution was to permute the first two dimensions, and this seems to be working well.
A special case was added for interleaved images, i.e. those with
(0x0028, 0x0006) Planar Configuration = 0
. These weren't fully supported before, but they should now be properly parsed.However, these images will still not be written correctly unless Planar Configuration is set to 1.
(Unrelated: a few tags/fields for animal scans were also added.)
I will merge this early next week if there aren't any objections.