CBICA / CaPTk

Cancer Imaging Phenomics Toolkit (CaPTk) is a software platform to perform image analysis and predictive modeling tasks. Documentation: https://cbica.github.io/CaPTk
https://www.cbica.upenn.edu/captk
Other
175 stars 63 forks source link

Utilities reorientation changes 4th dimension spacing #1299

Closed chiharusako closed 4 years ago

chiharusako commented 4 years ago

Describe the bug When reorienting a 4D image in Utilities, it doesn't preserve the 4th dimension spacing

To Reproduce As in the Utilities -inf below, it changes the 4th dimension spacing from original 1.5 to 1.

dir=/cbica/home/sakoc/comp_space/lab/captk/180b/utility_reorient
$ Utilities -i ACPN_2019.11.09_perf.nii.gz -o ACPN_2019.11.09_perf_LPS.nii.gz  -or RAI
Original Image Orientation: RPI

$ Utilities -i ACPN_2019.11.09_perf.nii.gz -inf
ITK Image information:.
Property,Value
Dimensions,4
Size,128x128x19x120
Total,37355520
Origin,-122.871498x137.560120x11.009907x0.000000
Spacing,1.875000x1.875000x4.000000x1.500000
Component,short
Pixel Type,scalar
Directions,[1.000000x-0.000000x0.000000;-0.000000x-1.000000x0.000000;0.000000x0.000000x1.000000;0.000000x0.000000x0.000000]

$ Utilities -i ACPN_2019.11.09_perf_LPS.nii.gz -inf
ITK Image information:.
Property,Value
Dimensions,4
Size,128x128x19x120
Total,37355520
Origin,-122.871498x-100.564880x11.009907x0.000000
Spacing,1.875000x1.875000x4.000000x1.000000
Component,float
Pixel Type,scalar
Directions,[1.000000x-0.000000x0.000000;-0.000000x1.000000x0.000000;-0.000000x-0.000000x1.000000;0.000000x0.000000x0.000000]

Expected behavior retain the spacing

CaPTk Version /cbica/software/lab/captk/centos7/1.8.0.Beta/bin/Utilities

sarthakpati commented 4 years ago

Fixed:

(base) PS C:\CaPTk_Full\1.8.0.Beta\bin> .\Utilities.exe -inf -i "C:\Downloads\ACPN_2019.11.09_perf.nii.gz"
ITK Image information:.
Property,Value
Dimensions,4
Size,128x128x19x120
Total,37355520
Origin,-122.871498x137.560120x11.009907x0.000000
Spacing,1.875000x1.875000x4.000000x1.500000
Component,short
Pixel Type,scalar
Directions,[1.000000x-0.000000x0.000000;-0.000000x-1.000000x0.000000;0.000000x0.000000x1.000000;0.000000x0.000000x0.000000]
(base) PS C:\CaPTk_Full\1.8.0.Beta\bin> .\Utilities.exe -inf -i "C:\Downloads\ACPN_2019.11.09_perf_rai.nii.gz"
ITK Image information:.
Property,Value
Dimensions,4
Size,128x128x19x120
Total,37355520
Origin,-122.871498x-100.564880x11.009907x0.000000
Spacing,1.875000x1.875000x4.000000x1.500000
Component,float
Pixel Type,scalar
Directions,[1.000000x-0.000000x0.000000;-0.000000x1.000000x0.000000;-0.000000x-0.000000x1.000000;0.000000x0.000000x0.000000]