Jeffrey L. O'Dell wrote:
> Apparently, the problem was in avwutils not working on the 4-d
> dimension when flipping. The workaround was to use fconvert
> under 3-D mode and to actively select the correct brick when
> running flirt.
Running fconvert with a -datatype float option further fixed this problem.
> ---- Original message ----
>
>>Date: Fri, 8 Oct 2004 10:41:59 -0500
>>From: "Jeffrey O'Dell" <[log in to unmask]>
>>Subject: [FSL] Sub-brick lost after using flirt
>>To: [log in to unmask]
>>
>>Greetings,
>>
>>After successfully converting Afni files (full EPI's, statistical
>>functional images, Axial images, and mprage's) using
>
> fconvert, I am
>
>>having trouble during the alignment process. Before flirt,
>
> the 92
>
>>points of the 4-D EPI are preserved, as are the 2 sub-bricks
>
> of the
>
>>statistical functional image. After flirt, however, only one
>
> of the
>
>>sub-bricks seems to be kept (cannot toggle through in
>
> fslview) when
>
>>viewing it overlaid on the mprage.
>>
>>Ultimately, the goal is to co-register the correct functional
>
> brick to
>
>>the mprage and then (possibly) move it back to Afni for
>
> talairach analysis.
>
>>Please pardon me if any of this is confusing or roundabout
>
> and thanks
>
>>for your time,
>>
>>-Jeffrey O'Dell
>>
>>
>>Below are the automated commands used to attempt this:
>>
>>-----------------------------------------------------------------------
>>
>>#!/bin/bash
>>## this script converts Afni MPRAGE, Ax, EPI and .fico files
>
> to Analyze
>
>>format
>>
>>subj = x
>>ddate = y
>>
>>mkdir "/data/mri/ANCfsl/S${subj}_${ddate}"
>>rm -rf "/data/mri/ANCfsl/S${subj}_${ddate}/"*
>>
>># MPRAGE 1st
>>
>>echo "Converting MPRAGE to anz format..."
>>/usr/local/fiswidgets/tools/bin/fconvert -in afni -dir
>>"/data/mri/S${subj}_${ddate}" -file
>
> "S${subj}_${ddate}+orig.HEAD" -out
>
>>anz -dir "/data/mri/ANCfsl/S${subj}_${ddate}" -file
>
> "S${subj}_MPRAGE"
>
>>-datatype int16 -aux "glmin = 0, glmax = 4000"
>>echo "DONE Converting MPRAGE to anz format..."
>>
>>echo "Fixing MPRAGE Orientation..."
>>avwswapdim
>
> "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_MPRAGE" z -x -y
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_MPRAGEfd"
>>
>>echo "Stripping MPRAGE Brain..."
>>/usr/local/fsl/bin/bet
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_MPRAGEfd"
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_MPRAGEfd_brain"
>
> -f 0.5 -g 0
>
>># Axials 2nd
>>
>>echo "Converting Axials to anz format..."
>>/usr/local/fiswidgets/tools/bin/fconvert -in afni -dir
>>"/data/mri/S${subj}_${ddate}Ax" -file
>
> "S${subj}_${ddate}_Ax+orig.HEAD"
>
>>-out anz -dir "/data/mri/ANCfsl/S${subj}_${ddate}" -file
>
> "S${subj}_Ax"
>
>> -datatype int16 -aux "glmin = 0, glmax = 4000"
>>
>>echo "Fixing Axial Orientation..."
>>avwswapdim "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Ax" x
>
> -y z
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Axfd"
>>
>>echo "Stripping Axial Brain..."
>>/usr/local/fsl/bin/bet
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Axfd"
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Axfd_brain" -f
>
> 0.5 -g 0
>
>># 1Hz raw (motion corrected) 3rd
>>
>>echo "Converting 1 Hz raw (mc) AFNI to anz..."
>>/usr/local/fiswidgets/tools/bin/fconvert -in afni -dir
>>"/data/mri/S${subj}_${ddate}EPIs" -file
>>"S${subj}_${ddate}_1Hz_mc+orig.HEAD" -out anz -dir
>>"/data/mri/ANCfsl/S${subj}_${ddate}" -file "S${subj}_1Hz_mc"
>
> -datatype
>
>>int16 -aux "4d = true, glmin = 0, glmax = 4000"
>>
>>echo "Fixing 1 Hz raw (mc) Orientation..."
>>avwswapdim
>
> "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_mc" x -y z
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_mcfd"
>>
>>echo "Stripping 1Hz raw (mc) Brain..."
>>/usr/local/fsl/bin/bet
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_mcfd"
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_mcfd_brain"
>
> -f 0.5 -g 0
>
>># 1Hz fim 4th
>>
>>echo "Converting 1 Hz fim (fico) AFNI to anz..."
>>/usr/local/fiswidgets/tools/bin/fconvert -in afni -dir
>>"/data/mri/S${subj}_${ddate}EPIs" -file
>>"S${subj}_${ddate}_1Hz_fim+orig.HEAD" -out anz -dir
>>"/data/mri/ANCfsl/S${subj}_${ddate}" -file "S${subj}_1Hz_fim"
>
> -datatype
>
>>int16 -aux "4d = true, glmin = 0, glmax = 4000"
>>
>>echo "Fixing 1 Hz fim Orientation..."
>>avwswapdim
>
> "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_fim" x -y z
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_fimfd"
>>
>># N.B. can't strip functional data - there's no brain or skull!
>>-----------------------------------------------------------------------
>>
>>-----------------------------------------------------------------------
>>
>>#!/bin/bash
>>
>># 1) align EPI (motion corrected - "mc") to Ax, save
>
> EPI2Ax.mat (can't
>
>>extract EPI brain!)
>># 2) align Ax to MPRAGE, save Ax2MPRAGE.mat
>># 3) align fim to Axial using EPI2Ax.mat, save fim_reg2Ax.hdr
>># 4) align fim_reg2Ax.hdr to MPRAGE using Ax2MPRAGE.mat, save
>>fim_reg2MPRAGE.hdr
>>
>>subj=501
>>ddate=042603
>>
>># align EPI to Ax
>>#
>>echo "Aligning S${subj}_1Hz_mcfd_brain to S${subj}_Axfd_brain..."
>>flirt -in
>
> "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_mcfd_brain"
>
>>-ref "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Axfd_brain"
>
> -omat
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/EPI2Ax.mat" -out
>>"/data/mri/ANCfsl/S${subj}_${ddate}/1Hz_mc_reg2Ax" -dof 6
>>
>>
>># align Ax to MPRAGE, save .mat and realigned Ax
>
> (Ax_reg2MPRAGE.hdr)
>
>>#
>>echo "Aligning S${subj}_${ddate}/S${subj}_Axfd_brain to
>>S${subj}_MPRAGEfd_brain..."
>>flirt -in
>
> "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Axfd_brain" -ref
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_MPRAGEfd_brain"
>
> -omat
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/Ax2MPRAGE.mat" -out
>>"/data/mri/ANCfsl/S${subj}_${ddate}/Ax_reg2MPRAGE" -dof 6
>>
>>
>># align fim to Ax using EPI2Ax.mat
>>#
>>echo "Aligning S${subj}_1Hz_fimfd to S${subj}_Axfd_brain
>
> using EPI2Ax.mat"
>
>>flirt -in
>
> "/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_1Hz_fimfd" -ref
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_Axfd_brain"
>
> -applyxfm -init
>
>>"/data/mri/ANCfsl/S${subj}_${ddate}/EPI2Ax.mat" -out
>>"/data/mri/ANCfsl/S${subj}_${ddate}/fim_reg2Ax"
>>
>>
>># align fim_reg2Ax.hdr to MPRAGE using Ax2MPRAGE.mat
>>#
>>echo "Aligning fim_reg2Ax to MPRAGEfd_brain using Ax2MPRAGE.mat"
>>flirt -in "/data/mri/ANCfsl/S${subj}_${ddate}/fim_reg2Ax" -ref
>>"/data/mri/ANCfsl/S${subj}_${ddate}/S${subj}_MPRAGEfd_brain"
>
> -applyxfm
>
>>-init "/data/mri/ANCfsl/S${subj}_${ddate}/Ax2MPRAGE.mat" -out
>>"/data/mri/ANCfsl/S${subj}_${ddate}/fim_reg2MPRAGE"
>>
>>
>>echo "Finished."
>>-----------------------------------------------------------------------
>>
>>Thanks if you read this far!
|