Not being Roland and al...
On 23. Mar 2007, at 18:49 Uhr, freesurfer-request(a)nmr.mgh.harvard.edu
wrote:
> Message: 2
> Date: Thu, 22 Mar 2007 15:18:05 -0400 (EDT)
> From: Bruce Fischl <fischl(a)nmr.mgh.harvard.edu>
> Subject: Re: [Freesurfer] Re: Freesurfer Digest, Vol 37, Issue 16
> To: Paul Aparicio <aparicio(a)mit.edu>
> Cc: freesurfer(a)nmr.mgh.harvard.edu
> Message-ID:
> <Pine.LNX.4.62.0703221517330.3420(a)gate.nmr.mgh.harvard.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> no, definitely don't use COR. I think you can use mri_convert -i[ijk]s.
> Rudolph: can you elaborate on how to do this?
here is what I use to accomplish this (in a csh script):
set targ_dir = /path/to/your/input_volumes
set targ_file_name = example.mgz
set conformed_vol = the_name_of_the_volume_with_faked_resolution.mgz
mri_convert -i ${targ_dir}/${targ_file_name} -o
${targ_dir}/${conformed_vol} -iis 1 -ijs 1 -iks 1
CAVEAT this expects isometric input scans, otherwise it gets a bit more
elaborate...:
this is what I used in the days of non-isometric scanning. It will
express all resolutions as multiples of the minmum so that resampling
later (by running mri_convert -cm ...) will do something reasonable.
You still have to make sure, that you have <= 256 voxels per
dimension...
ahoi & hope it helps
Sebastian
##### silly script to follow...######
#! /bin/csh!
# run number from the dicom file zero padded to three digits
set run = 008
# number of the first dicom file to contain data for this run (actually
any dicom file for a run should do'?)
set first_dicom = 34840259
# the session to work on
set session_dir = 050610Lupo
set dicom_dir = 06131042
set user_id = moeller
# where does the dicom data live
set src_dir = /space/data/raw_data/20${session_dir}/
set src_file = $src_dir/$first_dicom
# where to put the cor files
set targ_base_dir =
/space/data/${user_id}/cooked/anatomicals/$session_dir/mri
mkdir $targ_base_dir
# the next one has to match the run number from the dicom information...
set targ_dir = $targ_base_dir/orig
# get the dimensions (read from unpack.log)
# let's do it like freesurfer does (no error checkin though)
set first_two_dims = `mri_probedicom --i $src_file --t 28 30`
# tag 28 30 is of form 0.453125\0.453125, so split the critter at the
back slash
#echo $first_two_dims
set first_dim = `echo "$first_two_dims" | awk '{split($0, a, "\\");
print a[1]}'`
#echo $first_dim
set second_dim = `echo "$first_two_dims" | awk '{split($0, a, "\\");
print a[2]}'`
#echo $second_dim
# the slice resolution either in tag 18 50 or 18 88
set third_dim = `mri_probedicom --i $src_file --t 18 50`
#echo $third_dim
# get the shortest dimension, all this requires gnu bc to be installed
set min_dim = `echo "min = $first_dim; if (min > $second_dim) { min =
$second_dim }; if (min > $third_dim) { min = $third_dim }; min" | bc
-l`
set iis = `echo "scale=6; $first_dim / $min_dim" | bc -l`
set ijs = `echo "scale=6; $second_dim / $min_dim" | bc -l`
set iks = `echo "scale=6; $third_dim / $min_dim" | bc -l`
#for unpacking at raw resolution
mri_convert -i $src_file -o $targ_dir -it siemens_dicom -ot mgh #-iis
$iis -ijs $ijs -iks $iks
#end of script...
###################################################
--
Sebastian Moeller
Tel.: 04 21 - 2 18 - 78 38 oder 96 91
Fax.: 04 21 - 2 18 - 90 04
GSM: 01 62 - 3 25 45 59
moeller(a)brain.uni-bremen.de
AG Kreiter / FB 2
Institut fuer Hirnforschung III
Abteilung Theoretische Neurobiologie
Universitaet Bremen
Biogarten
Hochschulring 16a
Postfach 33 04 40
28359 Bremen