Hi Mark, thanks for the reply.
What I want to do is turn a coronal image into an axial image. This is
the storage order in the inputs
> qform_xorient Right-to-Left
> qform_yorient Superior-to-Inferior
> qform_zorient Posterior-to-Anterior
and what I need to have is this:
> [amw71]$ fslswapdim ANATOMY-2/3D_FSPGR_COR/897911.nii.gz LR PA IS test.nii.gz
From "RL SI PA" to "LR PA IS". I thought that fslswapdim was the right tool for that, and the label notation seems easiest to use (knowing that the correct orientation information is in the header) because I only need to specify the desired orientation.
But when I use that on 2 images from the same study, same scanner, same conversion program to nifti, I get:
> [oulu@bcni3 3D_FSPGR_COR]$ fslhd 1009911.nii.gz filename
> 1009911.nii.gz sizeof_hdr 348 data_type INT16 dim0 3 dim1 256 dim2 256
> dim3 146 dim4 1 dim5 1 dim6 1 dim7 1 vox_units mm time_units s
> datatype 4 nbyper 2 bitpix 16 pixdim0 0.0000000000 pixdim1
> 0.9375000000 pixdim2 0.9375000000 pixdim3 1.5000000000 pixdim4
> 0.0125759998 pixdim5 1.0000000000 pixdim6 1.0000000000 pixdim7
> 1.0000000000 vox_offset 352 cal_max 0.0000 cal_min 0.0000 scl_slope
> 0.000000 scl_inter 0.000000 phase_dim 0 freq_dim 0 slice_dim 0
> slice_name Unknown slice_code 0 slice_start 0 slice_end 0
> slice_duration 0.000000 time_offset 0.000000 intent Unknown
> intent_code 0 intent_name intent_p1 0.000000 intent_p2 0.000000
> intent_p3 0.000000 qform_name Scanner Anat qform_code 1 qto_xyz:1
> -0.937500 0.000000 0.000000 123.042999 qto_xyz:2 0.000000 0.000000
> -1.500000 130.822998 qto_xyz:3 -0.000000 -0.937500 0.000000 120.702003
> qto_xyz:4 0.000000 0.000000 0.000000 1.000000 qform_xorient
> Right-to-Left qform_yorient Superior-to-Inferior qform_zorient
> Anterior-to-Posterior sform_name Scanner Anat sform_code 1 sto_xyz:1
> -0.937500 0.000000 -0.000000 123.042999 sto_xyz:2 0.000000 0.000000
> -1.500000 130.822998 sto_xyz:3 0.000000 -0.937500 0.000000 120.702003
> sto_xyz:4 0.000000 0.000000 0.000000 1.000000 sform_xorient
> Right-to-Left sform_yorient Superior-to-Inferior sform_zorient
> Anterior-to-Posterior file_type NIFTI-1+ file_code 1 descrip
> FreeSurfer Mar 12 2007 aux_file [oulu@bcni3 3D_FSPGR_COR]$ fslswapdim
> 1009911.nii.gz LR PA IS f1009911.nii.gz [oulu@bcni3 3D_FSPGR_COR]$
> fslhd 897911.nii.gz filename 897911.nii.gz sizeof_hdr 348 data_type
> INT16 dim0 3 dim1 256 dim2 256 dim3 146 dim4 1 dim5 1 dim6 1 dim7 1
> vox_units mm time_units s datatype 4 nbyper 2 bitpix 16 pixdim0
> 0.0000000000 pixdim1 0.9375000000 pixdim2 0.9375000000 pixdim3
> 1.5000000000 pixdim4 0.0123120006 pixdim5 1.0000000000 pixdim6
> 1.0000000000 pixdim7 1.0000000000 vox_offset 352 cal_max 0.0000
> cal_min 0.0000 scl_slope 0.000000 scl_inter 0.000000 phase_dim 0
> freq_dim 0 slice_dim 0 slice_name Unknown slice_code 0 slice_start 0
> slice_end 0 slice_duration 0.000000 time_offset 0.000000 intent
> Unknown intent_code 0 intent_name intent_p1 0.000000 intent_p2
> 0.000000 intent_p3 0.000000 qform_name Scanner Anat qform_code 1
> qto_xyz:1 -0.937500 0.000000 -0.000000 125.385002 qto_xyz:2 0.000000
> 0.000000 1.500000 -86.677101 qto_xyz:3 -0.000000 -0.937500 -0.000000
> 118.360001 qto_xyz:4 0.000000 0.000000 0.000000 1.000000 qform_xorient
> Right-to-Left qform_yorient Superior-to-Inferior qform_zorient
> Posterior-to-Anterior sform_name Scanner Anat sform_code 1 sto_xyz:1
> -0.937500 0.000000 -0.000000 125.385002 sto_xyz:2 0.000000 0.000000
> 1.500000 -86.677101 sto_xyz:3 0.000000 -0.937500 0.000000 118.360001
> sto_xyz:4 0.000000 0.000000 0.000000 1.000000 sform_xorient
> Right-to-Left sform_yorient Superior-to-Inferior sform_zorient
> Posterior-to-Anterior file_type NIFTI-1+ file_code 1 descrip
> FreeSurfer Mar 12 2007 aux_file [oulu@bcni3 3D_FSPGR_COR]$ fslswapdim
> 897911.nii.gz LR PA IS f897911.nii.gz Cannot perform requested swap
> (NEUROLOGICAL/RADIOLOGICAL storage inverted) Try the following command
> instead: fslswapdim 897911.nii.gz RL PA IS f897911.nii.gz
The input images and their NifTI headers (their relevant fields) look exactly the same. Why does it work on one but not on another?
Best wishes
Alle Meije
|