Hi Mark,
Thanks very much for your help. The basic analysis protocol we've been using
looks like this:
Convert from dicom to nifti with medcon:
/home/fsl/xmedcon/bin/medcon -f *.MR -c nifti
move all magnitude images to one directory and all phase images to another.
Merge the magnitude images with fslmerge:
fslmerge -t mag_recog1 E1338S5*
Then realign with mcflirt:
mcflirt mag_recog1 -mats
Copy mat files directory to the directory where the phase images are stored.
Then apply the transformations to the phase images using flirt:
flirt -in E1338S5S5I$num -ref ref -applyxfm -init $xform -out
phaseE1338S5S5I$num"_motcorr"
(The reference image is the first magnitude image of the time series, but we've
also tried using the first phase image and the results are the same).
At this point (without any resampling) some of the realigned phase images are
blank, but we get the same results if before realignment we open the phase
images in imagej, convert to 32 bit float, and divide by a scale factor using the
image math function in imagej.
But following on from your and Steve's suggestions I had a closer look in the
headers and at the file sizes and it looks like the images that appear blank in
fslview and imagej are written out as 32 bit floats rather than 16 bit ints, eg
the 3rd and 8th images below:
8544 2010-01-18 15:04 phaseE1338S5S5I00002_motcorr.nii
8544 2010-01-18 15:04 phaseE1338S5S5I00004_motcorr.nii
16736 2010-01-18 15:04 phaseE1338S5S5I00006_motcorr.nii
8544 2010-01-18 15:04 phaseE1338S5S5I00008_motcorr.nii
8544 2010-01-18 15:04 phaseE1338S5S5I00010_motcorr.nii
8544 2010-01-18 15:04 phaseE1338S5S5I00012_motcorr.nii
8544 2010-01-18 15:04 phaseE1338S5S5I00014_motcorr.nii
16736 2010-01-18 15:04 phaseE1338S5S5I00016_motcorr.nii
8544 2010-01-18 15:04 phaseE1338S5S5I00018_motcorr.nii
The output from fslhd for these images is given below.
Do you know why some of the images are being written out with a different
data type (have I done something dumb in running flirt)?
Thanks again for all your help.
All the best,
Ruth
filename phaseE1338S5S5I00002_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
filename phaseE1338S5S5I00004_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
filename phaseE1338S5S5I00004_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
filename phaseE1338S5S5I00008_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
filename phaseE1338S5S5I00010_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
filename phaseE1338S5S5I00012_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
[fsl@k08802 phase]$ fslhd phaseE1338S5S5I00014_motcorr.nii.gz
filename phaseE1338S5S5I00014_motcorr.nii.gz
sizeof_hdr 348
data_type INT16
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 4
nbyper 2
bitpix 16
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
filename phaseE1338S5S5I00016_motcorr.nii.gz
sizeof_hdr 348
data_type FLOAT32
dim0 2
dim1 64
dim2 64
dim3 1
dim4 1
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 16
nbyper 4
bitpix 32
pixdim0 0.0000000000
pixdim1 3.4375000000
pixdim2 3.4375000000
pixdim3 3.0000000000
pixdim4 1.0000000000
pixdim5 1.0000000000
pixdim6 1.0000000000
pixdim7 1.0000000000
vox_offset 352
cal_max 0.0000
cal_min 0.0000
scl_slope 1.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 Unknown
qform_code 0
qto_xyz:1 3.437500 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 3.437500 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 3.000000 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 0.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown
file_type NIFTI-1+
file_code 1
descrip FSL4.0
aux_file
|