MCW AFNI UserMan ual

MedicalCollegeofWisconsin AnalysisofF unctionalNeuroImages

VersionDecember6

RobertWCoxPhD.

BiophysicsResearchInstitute MedicalCollegeofWisconsin WatertownPlankRoad MilwaukeeWI6

c

MedicalCollegeofWisconsin

SummaryMCWAFNIdisplaysthreedimensionalfunctionalneuroimagesoverlaidonto anatomicalreferencescansDatamaybetransformedtotheTalairachTournouxstereotaxicproportionalgridsystemImagesmaybegeneratedineachofthethreecardinal orthogonalplanesandswitchedamongmultiplefunctionalanatomicaldatavolumesAuxiliaryprogramsareprovidedtomanipulateandcombineDimagesetsTimedependent DimagesetsmayalsobestoreddisplayedandmanipulatedAnapplicationprogrammer interfaceisprovidedtoallowuserstoextendthefunctionalityofAFNIviaplugins.

DocumentThismanualdescribestheuseoftheAFNIprogramversionEarlier versionsxxaresupersededbythisversionbugsintheearlierprogramswillnolongerbe xedSeparatemanualsareprovidedfortheauxiliaryprogramsandfortheprogrammingofplugins.

DisclaimerThissoftwareanditsassociatedmanualsareprovidedASISandnowarranty fortheirusefulnessorcorrectnessforanypurposeismadeorimpliedbytheMedicalCollege ofWisconsinorbytheauthorThissoftwarehasnotbeenapprovedorevaluatedbythe UnitedStatesFoodandDrugAdministrationforanyclinicalapplication.

OwnershipandLicensetoUseThissoftwareanditsassociatedmanualsareCopyright bytheMedicalCollegeofWisconsinPermissionisgrantedtomakeuseofand tomakecopiesofthissoftwareanditsmanualsfornoncommercialresearchpurposesonly. Useofthesoftwareoritsmanualsbyforprotorganizationsisprohibitedwithoutprior writtenpermissionRedistributionofthisworkoranyderivedworkoutsideofthelicensed organizationisprohibitedwithoutpriorwrittenpermissionCopiesmaybemadewithinthe licensedorganizationwithoutseparatepermissionfromtheMedicalCollegeofWisconsin.

DistributionandRegistrationMCWAFNIisavailablefreeforresearchpurposesbutusers mustregisterwiththeMedicalCollegeofWisconsinForinformationsendanemailrequesttotheauthoratrwcoxmcweduwritetotheaddressaboveorseethenalpage ofthismanual.

AcknowledgementThisworkwasdevelopedwithinternalMCWfundsandwasalsopartly supportedbytheUnitedStatesNIHthroughgrantsMHandNS.

Con ten ts

Introduction3

WhatsNew4

Fundamentals6 Datasets6
Sessions9
ATourofAFNI 0 ResizingImageWindows9 ButtonClicksinaGraph0 MarkersfortheACPC AlignedTransformation7 Retransformationand RecreationofDatasets0
StartingUp0
ProgramControl1
ImageDisplay2
CrosshairsandtheView- point2
ColormapControls3
PositionControls4
DispControl4
SaveControl5
Montcontrol6
PopupMenu8
GraphDisplay9
Optmenu1
FIMmenu2
ViewingControls6
ViewModes6
DefineControls7
SwitchControls7
DefineMarkers7
MakingtheTransforma- tion9
TransformationtoStereo- taxicieTalairachCo- ordinates9
DefineFunction1
ThresholdSlider1
ColorPbar2
Options2
DefineDatamode3
Resampling3
DatasetOutputandIn- put3
ControllerLock4
Plugins5

Commandlineswitches5

TechnicalNotes7

mmaping7
machdeph8
XResourcesforAFNI8
FormulaforBkResampling8

Acknowledgements8

References9

MCWAFNIRegistrationForm0

In tro duction

AFNIisaninteractiveprogramforviewingtheresultsofDfunctionalneuroimagingItcan overlaytheusuallylowresolutionresultsoffunctionalbrainscansontohigherresolution structuralvolumedatasetsBymarkingducialpointsyoumaytransformthedatatothe proportionalgridstereotaxiccoordinatesofTalairachandTournouxTimedependent DvolumedatasetscanalsobecreatedandviewedAuxiliaryprogramsareprovidedfor combiningandeditingDandDtimefunctionaldatasets.

WiththisnewversionofMCWAFNImyintentionistoaddmanynewanalyticalcapabil

itiestothesoftwaresystemSomeofthesearefoundintheauxiliaryprogramsOthersare

foundintheAFNIprogramitselfinparticulartheinteractiveabilitytocomputefunctional

activationusingthecorrelationmethodThenewpluginscapabilityoersCliterateusers

theabilitytointegratetheirownanalyticaltoolsintoAFNIItismyhopethatothersites

willdevelopAFNIpluginsandsharethemwiththeFMRIcommunity. ! ThisdocumenthasbeenextensivelyrewrittenfromtheversionxmanualsMajornew

Whats

facilitiesinAFNIareoutlinedinthenextsection.

New�

! TheprogramrunsonUnixworkstationsusingtheXwindowingsystemandtheMotif ComputertoolkitforitsgraphicalinterfaceMinimumsystemrequirementstouseAFNIare2

requisites

MBRAMMBwillworkmuchbetterXRwithMotifanANSICcompiler, andenoughdiskspacetoholdtheDdatavolumesrequiredAFNIisdesignedtowork withorbitPseudoColorXvisualsAvisualofthistypemustbethedefaultvisual onthesystemusedtodisplayAFNITheprogramhasbeentestedonthefollowingsystems:

SGIIndigoworkstationsRandRCPUsrunningIRIXandIRIX.

HPworkstationsrunningHPUX.

IntelbasedLinuxsystems.

SunSPARCstationsrunningSolaris.

IthasnotbeentestedonotherplatformsItwillnotworkwithXRorMotifin particularitdoesnotworkunderSGIIRIXxTherearenoplanstoportittoradically dierentplatformssuchasMicrosoftWindowsortheAppleMacintosh.

AFNIisapowerfulprogramfordisplayandmanipulationoffunctionalneuroimageswith manyoptionsStudyofthismanualandexperiencewiththeprogramarebothrequired tomakefulluseofAFNISomeexperiencewithusingXisalsoveryusefulandwill beassumedinthismanual.

Nomenclature

IngeneralIrefertoMCWAFNIasthewholesoftwarepackageTheparticularprogram AFNIisattheheartofthepackageandisthesubjectofthismanualThepackage includesanumberofotherprogramsandtheprogramminginterfaceforcreatingplugins, bothofwhicharedocumentedelsewhere.

IfyoundMCWAFNIusefulandwishtorefertoitinapublicationtheappropriate citationis.

WhatsNew�

AtomicDatumTypes

PreviouslythedatastoredinanAFNIdatasethadtobebitsignedintegersshort datumThenewdatasetformatallowsforbitunsignedintegersbytedatum2 bitoatingpointsnumbersfloatdatumandbitcomplexnumberscomplex datumThepurposeofthebytedatumistoallowforcompactstorageofdatasets wheretherangehassucientprecisionThepurposeofthefloatdatumisto allowformorenaturalstorageofstatisticalquantitieswithouttheneedforrescalingto thelimitedrangeofvaluesallowedwithshortsButseeitembelowThepurpose ofthecomplexdatumistoeventuallyallowforunprocessedreconstructedimagesto bedirectlyimportedintoAFNI.

ScaleFactors

EachDsubbrickinadatasetcannowhaveaoatingpointscalefactorattachedto itThepurposeofthisistoallowdatatobestoredinthemorecompactbyteorshort formatsbutalwaystobeautomaticallyscaledtothecorrectunitswhenaccessedby anMCWAFNIprogramForexamplecorrelationcoecientscanstillbestoredas shortsbutwillbescaledbytotheirtruerange] beforebeingdisplayedorprocessedThenewinteractiveFIMutilityinAFNIdoes thisseeitembelowThenewtodcantakeasinputoatingpointvolumesand scalethemtoproduceshortorbytedatasetswiththeappropriatescalefactors) attached.

AuxiliaryStatisticalData

Therearethreenewtypesofdatasetstheficofittandfiftfunctionsficomeans functionalintensitywithcorrelationfittmeansfunctionalintensitywithttest� fiftmeansfunctionalintensitywithFtestThesearesimilarinconcepttothe fithimagesbutthethresholddatanowhasthestatisticalparametersegdegrees offreedomattachedthatallowcalculationofthesignicanceplevelWithsuch adatasetAFNIwillinteractivelydisplaythepvalueassociatedwiththechosen thresholdAtpresentonlyAFNIanddmgeneratedficodttestgeneratedfitt, anddANOVAgeneratedfiftdatasetshavethestatisticalparametersautomatically attachedUsingthenewtoditispossibletocreateyourowndatasetsofthesetypes ifyouprovidetheneededauxiliarystatisticalparameters.

DemiseofDatasetNameandShortLabel'

ThesevaluesarenolongerusedintodorAFNIThelenameofadatasetisnow usedfordisplayintheAFNIwindowtitlebarsandselectionchoosers.

Theoriginalpurposeofthenameandshortlabelvalueswastoassigndescriptionsto adatasetthatdidnotdependonthelenameThisisneededwhenonedatasetrefers toanotherwhichhappensduringthewarpondemandprocedureIfyourenameda datasetandiflenameswereusedastheinternalmethodofkeepingtrackofsuch referencesAFNIwouldgetconfusedTosolvethisproblemIhaveinsteadputinside eachdatasetsHEADleaninternallygeneratedidentiercodeThisisdesignedto beuniqueandindependentoflenamesWhenyourunanAFNIprogramonanold

datasetyouwillseeamessagethatitisgeneratinganewIDcodeTheseIDcodes arepseudorandomlygeneratedusingthecurrenttimeandmachinenameasseedsFor moreinformationseethepluginsmanual.

IfyouusetheUnixcommandcptocopyadatasetthenthenewdatasetwillhave thesameIDcodeastheoriginalAFNIwillnotruncorrectlyiftwosuchdatasets arereadintotheprogramToxthisyoucanusetheauxiliaryprogramdnewidto attachanewIDcodetoadataset.

DtimeDatasets

AFNInowsupportstimedependentDdatasetswhichIrefertoasDtimedatasets. Atpresentonlyanatomicaldatasetsmaybeusefullysetuptobetimedependent. Dtimedatasetsarecreatedwithtodusingthenewtimeztortimetzcommandlineswitches.

Dtimedatasetscanbeviewedintheimageviewingwindowsintheusualorthogonal slicesScrollingintimethroughtheseviewsisagoodwaytocheckforsubject movementTheycanalsobegraphedvstimesimilartotheprogramFD.

InteractiveFunctionalActivationAnalysis

AFNInowhastheabilitytoruntheequivalentofthemprogramonaDtime datasetproducingasoutputanewDficodataset.

ImageMontage

OneofthemostvisiblechangestoAFNIitselfistheadditionofthemontagedisplay ofanarrayofslicesfeaturetotheimageviewingwindowsThisisaccessedusingthe newMontbutton.

BigTalairachBox

ThesizeofthedefaultTalairachcoordinatesbrickhasbeenextendeddowninferior) bymmThisistomakesurethatthebrickincludestheentirecerebellumwhich isnotthecaseusingtheoldbrickdimensionstakenfromtheAtlas.

ThresholdResampling

Thetypeofinterpolationusedforfunctionaldatasetresamplingiscontrolledbythe ResammodebuttonintheDatamodecontrolpanelInAFNIxboththefunctional intensityfimandthethresholddatawereresampledusingthechosenmethod. InthisversionofAFNIthethresholddataegcorrelationcoecientisalways resampledusingtheNNmethodThisisbecausethresholdingwithaninterpolated nonlinearstatisticisasomewhatdubiousprocedure.

MultipleAFNIControllers

UsingtheNewbuttonyoucanopenupmultiplecontrollerwindowsinasinglerun ofAFNIThisallowsyoutoviewmorethanonedatasetatatimeUsingtheLock menuyoucanforcethecoordinatesofthedierentviewingwindowstobelocked togetherThisfeatureallowsyoutoscrollinunisonthroughmultipledatasets.

SessionDirectories

IfyoudontspecifyanydirectoriesonthecommandlinethenAFNIactsasifyou hadtypedthatisitwilltrytoreaddatasetsfromthecurrentdirectoryThe newRswitchwilltellAFNItoreadfromallsubdirectoriesofthegivensession directoriesrecursivelyUsingtheRescanbuttonsyoucanrereadsessionsThisis usefulifyouuseanauxiliaryprogramegdmergetocreateadatasetandthen wanttoimportitintoAFNI.

WritingManyDatasetstoDiskatOnce

AnewbuttonallowsyoutoselectmanydatasetsatonceforoutputtodiskThis makesitpossibletostartalongTalairachoutputsessionandthenleavethecomputer unattendedwhileitcomputeseachoutputBRIK.

3 F undamen tals
ThissectionexplainshowdataisorganizedintheMCWAFNIpackageThetwoindis
pensableconceptsaredatasetsandsessions.
Datasets
! ThefundamentalunitofdatainAFNIisthedatasetoneormoreDbricksofimaging
Crucial informationdatatogetherwithsomeauxiliaryinformationegaxesorientationcoordinatesofmarked
ducialpointsTherearetwoclassesofdatasetsanatomicalandfunctionalAn
exampleoftheformerwouldbeaSpoiledGRASSMRIscanAnexampleofthelatterwould
betheresultsofcrosscorrelatingafunctionalMRIFMRItimecourseofimagesWhen
youcreateadatasetusingthetodprogramyoumustspecifywhetheritisanatomicalor
functionalinnatureWhenyouareusingAFNIatanygiventimeyouwillbedisplaying
oneanatomicaldatasetasthegrayscaleunderlayandpossiblyonefunctionaldataset
asthefalsecoloroverlay.
Withintheclassofanatomicaldatasetstodprovidesyouwithalistofpossibletypes
egSpoiledGRASSEchoPlanarMRAngiogramAtpresentallanatomicaltypes
ofdatasetsaretreatedidenticallyTheonlyreasonforchoosingaparticularanatomical
typeistoremindyourselfofthedatasetsorigin.
! AnatomicaldatasetsmaybeintheDortheDtimeformatTheDformatstores
Dtime onevaluepervoxelTheDtimeformatstoresaseriesofvaluespervoxelThiscanbe
usedtostoredallthedatafromaDFMRIimagingrunTheauxiliaryprogramdmor
theinternalAFNIFIMcapabilitycanbeusedtoproducefunctionalactivationdatasets
fromDtimedatasets.
Withintheclassoffunctionaldatasetstherearepresentlyvetypes.
fim FunctionalIntensity
onevalueisstoredpervoxel

fithFunctionalIntensityThreshold twovaluesarestoredpervoxel: therstisintensitydenedarbitrarily� thesecondisthresholdwhichisaeitheraoatingpointnum

berbetweenandorabyteintegerbetween0 andwhichcanbeusedtoselectwhichvoxelsareconsideredactive.

ficoFunctionalIntensityCorrelation twovaluesarestoredpervoxel: therstisintensity� thesecondisacorrelationcoecientbetweenand,

whichcanbeusedtoselectactivevoxelsatagivensignicance pvalue.

fittFunctionalIntensityttest twovaluesarestoredpervoxel: therstisintensity� thesecondisatstatisticwhichcanbeusedtoselectactive'

voxelsatagivensignicance. fiftFunctionalIntensityFtest twovaluesarestoredpervoxel: therstisintensity� thesecondisanFstatisticwhichcanbeusedtoselectactive' voxelsatagivensignicance.

ByintensityImeanasignednumberindicatingtheleveloffunctionalactivityineachvoxel. IconsiderthefithdatasettypetobeobsoleteItisretainedforcompatibilitywithAFNI versionxThelatterthreefunctionaltypesdierfromthefithtypeinthatAFNIknows howtostatisticallyinterpretthesecondvalueattachedtoeachvoxel. ! Thevaluesstoredateachvoxelcanbeanyofthefollowing:

Atomic datum

byteatypedefforunsignedchar

shortbytesignedint floatsingleprecisionbytes complexastructcontainingtwofloatsbytes

IrefertothesetypesastheatomicdatumtypesofadatasetFloatandcomplexdatasets maynotbeportablebetweenCPUarchitecturesAlsoshortdatasetsmayneedtobe byteswappedifthelesaremovedtoadierentcomputerSpecicallyIntelCPUsare reversedfrommostotherUnixsystemssothatshortbricklescreatedonanSGIsystem wouldhavetobebytereversedbeforetheycouldbeusedonanIntelbasedsystemThe auxiliaryprogramswapcanperformthisfunction.

FormostpurposestheshortatomicdatumisthemostusefulEachDbrickwithina shortorbytedatasetcanhaveaoatingpointscalingfactorattachedsothattheAFNI programswillinterpretthevaluestoredasfactorvoxelvalue.

DatasetsarestoredintwolestheheaderandbricklesTheheaderlecontainsallthe
auxiliaryinformationaboutadatasetstoredinanASCIIformatThebricklecontains
onlytheactualDvolumedataFordetailsonthestorageseetheAFNIpluginsmanual.
! Thelesinadatasethavehighlystructurednamesandthesenamesshouldnotbe
FilenamescasuallyalteredorAFNIwillnotbeabletoreadthemThegeneralformofthedataset
lenamesisprefixviewNAMEwhereprefixistobesuppliedbytheuseryouand
presumablywouldbeusedtoindicatethetypeofdatastoredintheleegspgrfor
SpoiledGRASSfuncforfunctionalintensityetcTheviewcodeindicatestheorigin
ofthedataandisassignedbyAFNIthepossibilitiesare:
origfororiginaldatauntransformedbyAFNI)
acpcfordatasetswhichhavebeenalignedtotheACPCline
tlrcfordatasetswhichhavebeentransformedtotheTalairachTournouxgrid
DatasetsintheacpcandtlrcviewswouldnormallybecreatedbyAFNIorigles
wouldbecreatedbytodTheNAMEsuxisHEADfortheheaderleandisBRIK
forthebrickle.
Onereasonforsplittingtheauxiliaryinformationfromthevolumedataineachdatasetis
foreciencyofaccesstothebrickleAnotherreasonisthatinanemergencytheauxiliary
informationisstoredinASCIIformandsocanbeeditedmanuallythisrequiresextreme
careAthirdreasonisthatwhentransformeddatasetsacpcandtlrcarecreated,
theirbricklesmaybedeletedlatertosavediskspaceaslongasthetransformedheader
lesandtheorigbricklesexistAFNIcanrecreatethetransformeddata.
OncerawimageshavebeenputintotheAFNIdatasetformattheyarenolongerneeded
foranyoftheprogramsdescribedhereinItisalwayspossibleusingAFNIorfromd)
toextractimagesoutoftheDdatabrickalthoughyoumaythenhavetoconvertthem
intowhateverformatyoudesire.
Ifyouchoosetorenamethepairoflesthatmakeupadatasettheonlypartyou
shouldtouchistheprexIfyoualterthevieworNAMEpartsAFNIwillprobably
refusetoreadthelesatall.
! NotalldatasetswillhaveaBRIKleAFNIiscapableoftransformingdatafroma
WarpondemandparentdatasetasneededforimagedisplayIfthenecessarytransformationegfrom
origtotlrcisavailablethenthechilddatasetegthetlrcdatasetneednothave
aBRIKleitcanbewarpedondemandfordisplayNormallyorigdatasetsdonot
haveawarpparentdatasetsotheymusthaveaBRIKleAnexceptiontothisrulecan
becreatedwiththeauxiliaryprogramddup)
AtthistimenoprogrambutAFNIitselfcandealwithwarpondemanddatasetsThat
isalltheauxiliaryprogramsandpluginsmustdealwithactualdatasetBRIKs.
Sessions
! AllofthedatasetlesthatgotogethershouldbegatheredintoasingledirectoryBygo
Crucial informationtogetherIspecicallymeanthosedatasetsgatheredduringthesamescanningsessionona
singlesubjectAftertheirpositionsandorientationsaresetupintodallthesedatasets
arepresumedtobealignedtooneanotherIfthisisnotthecasethentheimagesmaking
upthedatasetsshouldberegisteredbeforeentryintotodTheauxiliaryprogramimregmay
beusefulforthispurposeAlternativelytheprogramAIRfromUCLAmightbeneeded.
AIRisavailableathttpbishopwloniuclaeduAIRindexhtml.
AdirectorycontainingdatasetsiscalledasessionThehierarchyoflesthatmake
upasessionispicturedbelow:
session topleveldirectory
\
\
/ | \
headerheaderheaderactualdatafiles
brickbrickbrick
headerheaderheader
brickbrick
Itispermissibletosaveotherlesegtheoriginalimagelesinthesessiondirectory
theseleswillsimplybeignoredbyAFNI.
AFNItakesasinputacollectionofsessionsspeciedbytheirdirectorynamesand
allowsyoutoswitchbetweenthemandbetweentheirconstituentanatomicalandfunctional
datasetsItisimportanttounderstandthedatasetconceptslestructureanddirectory
hierarchydescribedanddepictedabove.
! Sessionsarereferredtobythetopleveldirectorynameunderwhichalltheirdatasets
Command linenames resideAnindividualdatasetisreferredtoonauxiliaryprogramcommandlinesbythe
forsessionsnameofitsheaderlethenameofitsbrickleorjustbytheprefixviewpartofthe
datasetslenamesforexample,
decfuncacpcHEADdecfuncacpcBRIKdecfuncacpc
wouldallrefertothesamedatasetresidinginagivensessiondirectory.
Bymovingtothedirectoryabovethesessiondirectoryyoucansaveandcompressallthe
lesinasessionusingthecommand
tarcvfsessiondirectorygzipvsessiontgz
ThispresumesthatyouhavetheGNUgzipcompressionutilityinstalledonyoursystem.
Thecommandtouncompressandrestorefromthecompressedarchivewouldbe
gzipdcsessiontgztarxvf

AT ourof AFNI

Thebestwaytolearntheprogramistoreadthistourthroughandthensitdownwith theprogramandtryitout.

StartingUp

ThecommandlinetorunAFNIisquitesimple:

afnisessionsession.

HeresessionisthenameofasessiondirectorytoreadinAlltheDdatasetsunder eachnamedsessiondirectorywillbereadinIfnosessionsarespeciedonthecommand linethecurrentworkingdirectorywillbeusedCommandlineoptionsforAFNIwill bediscussedinalatersection)

ForAFNItobeabletouseasessionitmustcontainatleastoneanatomicaldataset DorDtimeIfnoneareavailabletheauxiliaryprogramddupcanbeusedtocreate awarpondemandcopyofafunctionaldatasetAlternativelyyoucouldusetherstimage fromtheFMRItimecourseineachslicetoformananatomicaldatasetbutaseparate higherresolutionscanwillbemoreusefulandlookbetterAtanygivenmomentinAFNI, youareviewingonegivenanatomicaldatasetandpossiblyonegivenfunctionaldataset. Controlsaresuppliedtoletyouswitchamongsessionsandamongdatasetswithinsessions.

Ausefulmodelistothinkofeachsessionasbeingorganizedinatwodimensionallayout:

ViewType

origacpctlrc

anatX X

prefixangioX O

funcX O

funcX O

AcrossthetopistheviewtypeOriginalACPCalignedorTalairachDownisthe datasetprexXsmarkdatasetsthatactuallyexistondiskInthesampleabovethe anatoriginaldatahasalsobeentransformedtotheACPCalignedviewusingthemarker driventransformationdescribedlater.

WhenAFNIstartsalltheotherdatasetsinthissessionwillalsohaveACPCaligned viewversionsmadeinternallyintheprogramtheseareindicatedbyOsinthetableabove. NoHEADleswillbewrittenforthesedatasetsatthistimeThesedatasetswillbewarpondemanduntilandunlessyouwriteouttheBRIKlesusingoneoftheWritebuttons describedlaterThetransformationfromorigtoacpcintheanatdatasetstoredinthe HEADlewillbeappliedtotheotherdatasetsintheorigviewThesefollowerdatasets arewhatmakesAFNIworkandeasytouseWhentheanattransformationfromacpcto tlrcisdenedwhentheXisplacedatthetopofthethirdcolumnthenalltheother datasetsinthissessionwillagainfollowalongOswillllintherestofthethirdcolumn.

MCWAFNI2.00 { Dec6

Forthistobepossibleitisnecessarythatthecorrectgeometricalrelationshipbetween thedatasetscomprisingasessionbeestablishedwhentodisrunthatistheimportof gettingtheaxesorientationsandoriginscorrectintod.

! AFNIisalsocapableofdirectlyreadinginanddisplayingasetofimagelesUsethe

afniim

commandafnihelpfordetailedinstructionsonhowtodothisInthismodenoneof thecontrolsfordatasettransformationfunctionaloverlayetcareavailable. AfteryoustartAFNIacontrolwindowopensontheXscreen:

AFNIcontrollerandimageviewingwindows

ProgramControl

Atthelowerleftofthecontrolpanelarefourbuttonswhichcontrolvariousglobalprogramfunctions:

NewThisbuttonwillopenupanewAFNIcontrollerwindowInthiswayitispossibleto openupimageviewersonmorethanonedatasetorsessionatatimeAmaximum ofcontrollerwindowscanbeopenatonceTherstcontrollerwindowandits childrenaremarkedwithAintheirtitlebarsthesecondismarkedwithBandso forth.

ViewsThisbuttonwillopenandclosethecontrolpanelstotherightoftherstcolumn ofthecontrollerwindowtherstsuchcontrolpanelstartswithOriginalViewinthe gureaboveThisfunctionallowsyoutosavesomescreenspacewithouticonifying thecontrollerwindow.

BHelpThisbuttonallowsyoutopopupahelpwindowformostcontrolswithinAFNI. PressingBHelpwillcausethemousecursortochangetoasmallhandshapePressing

MCWAFNI2.00 { Dec6

mouseButtonwhilethehandisoveranAFNIcontrolwillpopupahelpwindowfor thatcontrolClickingButtoninsidethehelpwindowwilldismissit.

ButtonhelpisimplementedasahelpcallbackinMotifIfyourterminalkeyboard isappropriatelysetupthenpressingtheMotifHelpkeyoftenFwhilethemouse cursorisoverabuttonorotherwidgetwillalsocausethehelpwindowforthatwidget topopup.

doneThisbuttonwillclosethecontrollerwindowwhenpressedtwicewithinseconds. IfthisistheonlycontrollerwindowrunningAFNIwillalsoexitFormoredetails, tryusingBHelpondone)

TheMCWlogowillappearintheemptyspacejusttotherightofthesefourbuttonswhen theprogramisdoingsomeoperationthatispotentiallytimeconsumingAtthesametime, themousecursorwillchangetoawatchshapeWhenthetimeconsumingoperationisover, thelogowillberemovedandthecursorwillchangebacktoitsusualarrowshape.

AtrickIsometimeusetovisuallygrabattentionwhenalengthytaskisunderwayisto clicktheSwapbuttoninanimagewindowThiswillturntheimagestoreversevideowhen theprogramcatchesupwithyouThenSwapagainandproceed.

ImageDisplay

Therstcolumnofthecontrollerwindowcontainsthecontrolsthatenableyoutoopenthe imageviewingwindowsthethreeImagebuttonsThewindowsopenseparatelyonthe XdisplayscreenandmaybepositionedandresizedindependentlyAlittlepracticeis neededtodecideuponagoodlayoutschemeforthesewindowsThereasonAFNIdoesnot denetheirlocationsandsizesisthatitisoftendesirableexpandonewindowtolookat somedetailsandtemporarilycoveruptheotherwindows.

WhenanImagebuttonishighlightedininvertedcolorsthismeansthatitswindowisalreadyopenPressingthebuttonagainwillbringthatwindowtothetopofthedisplaythis isusefuliftheimageviewingwindowishiddenbeneathsomeotherwindoworisiconied.

AnimageviewingwindowcanbeclosedbyusingtheDonebuttonalongitsbottomedge. AlternativelythewindowmanagerCloseorDeletefunctionmaybeused.

CrosshairsandtheViewpoint

Youcanhaveuptothreeimageviewingwindowsopenatanygiventimeoneaxialone

sagittalandonecoronalIntheaxialandcoronalwindowsimagesaredisplayedwith ! thesubjectsleftonthescreenrighttheusualradiologicalconventionThesewindows

Leftis

areorthogonalslicesthroughtheDdatasetThecoloredcrosshairsthatoverlayeach

Right!

imagemarktheslicesthatarevisibleintheotherimagewindowsThepointatwhichthe crosshairsintersectiscalledtheviewpoint.

IntheupperlefthandcorneroftheAFNIcontrollerwindowaredisplayedthecoordinates ofthecurrentviewpointThesecoordinatesarepresentedintheDICOMstandardorder:

xaxisisRightnegativetoLeftpositive) yaxisisAnteriornegativetoPosteriorpositive)

zaxisisInferiornegativetoSuperiorpositive)

InternallyAFNIusesDICOMcoordinatestokeeptrackofeverythingHoweverAFNI cannotreadDICOMles)

ThebuttonXhairsjustunderthecoordinatedisplayallowsyoutoswitchbetween3 modesforcrosshairdisplay:

OffCrosshairsarenotdisplayed.

SingleAsinglecrosshairisdisplayedatthexyzcoordinatesoftheviewpoint' iethepointwhosecoordinatesaregivenintheupperleftcorner.

MultiIfamontageofslicesisdisplayedinanimageviewingwindowthentheorthogonal sliceswillhavecrosshairsindicatedforallthemontagedslicesThisisusefulfor indicatingtheanatomicallocationofthemontagelayout.

Youmaychangethecrosshaircolorandcentralgapwiththeselectorsjustunderneaththe

XhairsbuttonThecolorsavailableforthevariousoverlaysarebuiltintoAFNIbutcan bealteredbyappropriatechangestoyourXdefaultsle.

Ifyouclicktheleftmousebuttonwhilethecursorisinanimagewindowthenthe crosshairswillimmediatelyjumptothatlocationThiswillusuallymeanthattheothertwo windowswilldisplaynewslicesTheimagewindowsarealwayslinkedinthisfashion.

TheIndexcontrolontheAFNIcontrollerwindowisusedtocontrolthetimeindexof theviewpointThiscontrolisonlyactiveifthecurrentanatomicaldatasetisintheDtime formatThetimeindexcanalsobecontrolledinagraphviewer)

ColormapControls

AttherightofeachimagewindowisasetofbuttonsthatareusedtocontroltheX1 colormapassignedtothewindowsFromtoptobottomthesecontrols

ColrChangefromgrayscaletoacolorscaleandback.

SwapInvertthegrayscaleorcolorscaleswapitendforend.

NormReturnthecolormaptoitsinitialstateafteryoumessitup.

c

Changethecontrastofthegrayscaleamultiplicativechangetotheintensityofeach pixel.

bChangethebrightnessofthegrayscaleanadditivechangetotheintensityofeach pixel.

r

Rotatethegrayscaleorcolorscale.

gChangethecorrectionfactorforthegrayscale.

iChangethefractionoftheviewingwindowtakenupbytheimage.

Youmayhavetodragtheviewingwindowstobelargerthantheirinitialsizessothatthese andtheothercontrolsdontobscureeachotherChangingthecolormapinoneviewing windowaectsalltheotherwindowsfromthesameAFNIprocess.

PositionControls

BeloweachimageisasliderthatindicatestheimagenumberinthecurrentsequenceBy draggingthisslideryoucanmovethroughtheslicestoanygivenslicenumberIndoingso, youwillalsomovethecrosshairsintheothertwoimagewindows.

Atthelowerrightoftheimagewindowisanarrowpadoffourarrowsarrangedina NEWSpatternplusacentralbuttonClickingononeofthearrowswillcausethe crosshairviewpointtomoveonevoxelinthedirectionpointedbythearrowinthatwindow. Clickingonthecentralunlabeledbuttoncausesthecrosshairgaptocloseclickingthis buttonagaincausesthegaptoopenupagainThisisveryusefulwhenpositioningthe crosshairspriortosettingananatomicalmarker.

ImageviewerDispandMontcontrolpanels

DispControl

Thisbuttonopensupacontrolpanelpicturedabovethatletsyouchangehowtheimages willbedisplayedinthiswindowTheRotationandMirroritemscontroltheorientation oftheimageinthewindowTheNoOverlayitemallowsyoutoturnoallcoloroverlay itemsiecrosshairsanatomicalmarkersandfunctionTheMintoMaxandto%

MCWAFNI2.00 { Dec6

itemschoosehowthevaluesintheimagearrayaremappedtograyscalelevelsonthescreen. Theformerchoicemapstheminimumimagevaluetoblackandthemaximumtowhite� thelatterchoicecomputesthecumulativehistogramoftheimageandmapsthepoint toblackandthepointtowhite.

TheFreeAspectcontrolletsyouresizetheimagewindowtoanybizarreaspectratio. Normallytheprogramrestrictstheimagewindowresizingsoastokeepthedatavoxelto displaypixelgeometricrelationshipcorrectassumingthatdisplaypixelsaresquare.

TheSavecontrolsactuallyhavenothingtodowithimagedisplayTheyarejusthere becauseitwasaconvenientplacetoputthemTheycontroltheoperationoftheSave: buttonontheimageviewingwindownexttotheDispbuttonthisisdiscussedbelow.

TheTranmenusallowyoutopickfromalistofimagetransformationsTheTranD transformationsareallpointwisethatistheimageintensityoutputatagivenpixelis afunctionoftheimageintensityinputatthatgivenpixelonlyThebuiltinTranD functionsareLogandSSqrtwhichtakethecommonlogarithmlogofeachpixel, andtakethesignedsquarerootsgnxjxjofeachpixelrespectively.

TranDfunctionsaremoreglobalimagetransformationswheretheimageintensity outputatagivenpixelcanbeafunctionofotherpixelsTheonlybuiltinTranDfunction isMedianwhichreplaceseachpixelbythemedianoversitsneighborhood.

AFNIpluginauthorscanaddfunctionstotheseTranmenushopefullytheywillbedocumentedAtthebottomoftheDisppanelareotherbuiltinimageprocessingfunctions:

FlattenHistogramatteningorequalizationisperformedontheimagepriorto display.

SharpenHighemphasissharpeningisperformedontheimagepriortodisplayWhen printingimagesonprinterswithrelativelyfewcolorsavailableperpixelthecombinationofMedianandSharpengivesniceresults.

EdgeDetectSobeledgedetectionisperformedontheimagepriortodisplay.

Ifmorethanoneoftheseareselectedtheyareperformedinthetoptobottomorderas displayedalsotheseoperationsareperformedafteranyTranfunctions.

SaveControl

ThisbuttontakesoneofthreeformsdependingonthechoicesmadeintheDisppanel:

SaveoneThisformoftheSavefunctionisselectedbytogglingontheSaveOneoption ontheDispcontrolpanelInthisformtheactionistosavethecurrentimageto diskThisistheonlywayprovidedbyAFNItosaveamontagelayout.

Thisbuttonpopsupalittlechooserwindowwhichasksyoutoinputthelename

prexfortheoutputimageTheimagewillbesavedintherawPNMformatwiththe

nameprefixpnmImagesinthisformatcanbeconvertedtootherformatssuchas ! TIFFwithcommandlineutilitiesinthenetpbmpackageorthexvsharewareprogram. netpbm ImageswhichcontainnocolorwillbesavedinthePGMformatimageswithcolored

andxv

pixelswillbesavedinthePPMformat)

SavepnmThisformoftheSavefunctionisselectedbytogglingonthePNMSaveoption ontheDispcontrolpanelInthisformtheactionistosaveacollectionofsliceimages underlayandcoloroverlaytodiskintherawPNMformatEvenifamontageis beingdisplayedonlysinglesliceswillbesavedwiththisfunction.

Thisbuttonalsopopsupachooserwindowwhichasksyoutoinputthelename prexfortheslicedataIfyouenterfredfortheprexthenthethslicewouldbe namedfredpnmAfteryoutypeinthedesiredprexyouclicktheSetbutton, andthenmustchoosetherstandlastsliceindexesforthesaveoperationfromthe newchoosersthatwillpopupWhenyouSetthelastsliceindexthewritetodisk operationstarts.

SavebkgThisformoftheSavefunctionisselectedbytogglingothePNMSaveand SaveOneoptionsontheDispcontrolpanelInthisformtheactionistosavethe backgroundimagepixelvaluesThisdoesnotmeanthegrayscaleintensitiesdisplayed inthewindowItmeansthattheactualvaluesstoredinthedatasetBRIKlewillbe writtentodisk.

ThisbuttonoperatessimilarlytotheSavepnmfunctionyoumustchoosealename prexandtherstandlastsliceindexesforthesaveoperationIfNsizeSaveis selectedontheDispcontrolpanelthenthesavedimageswillbeexpandedtothe nextlargestpoweroftwo.

UsingtheFunctioncontrolsyoucanswitchtohavethefunctiondisplayedasthe backgroundInthatwaythefunctionaldatasetvoxelvaluesmaybewrittentodisk insliceformatAlternativelytheauxiliaryprogramfromdcanbeusedtowriteslice imagelesoutofadataset.

ForallSaveoptionstheactualsizeofthedisplayedwindowdoesntmattertheimages savedtodiskwillreectthevoxeldimensionsofthedatasetInparticularifthedataset voxelsarenotsquareintheplaneofviewthenthesavedimageaspectratiowillbedistorted. TheonlywaytorectifythisinAFNIistoswitchthedatasettobewarpondemandusing theDatamodecontrolswhichalwaysinterpolatestosquarepixels.

Toactuallysavethepixelsasdisplayedonthescreensomesortofsnapshotorwindow grabutilityisneededIfnoneotherisavailablethesharewareprogramxvhasawindow grabfunctionOrthexwdcommandlineprogramcanbeusedwithappropriateconversion usingthenetpbmutilitiesForexampletheimagesdisplayedinthismanualwerecaptured withvariantsofthefollowingcommandline:

xwdframexwdtopnmpnmdepthppmtopgmpgmnormpnmtopsnoturnnameeps

Montcontrol

ThisbuttonallowsyoutomakeamontageofmorethanonesliceintheimagewindowIt popsupacontrolpanelpicturedearlierandbelowForconvenienceinprogrammingonly oneoftheDispandMontcontrolpanelscanbeopenatatimeperimageviewerThis restrictionmaybeliftedinsomelaterversionofAFNIbutnoguarantees.

ExampleofslicemontagewithMontcontrolpanel

Thevemontagemenucontrolsfromtoptobottomare:

AcrossThiscontrolsthenumberofslicestobedisplayedhorizontallyacrossthewindowIntheexampleaboveAcrossandDownarebothsetto.

DownThiscontrolsthenumberofslicestobedisplayedverticallydownthewindow.

SpacingThiscontrolsthefrequencywithwhichslicesaredisplayedSpacingof1 meansthatadjacentsliceswillbedisplayedmeansthateveryotherslicewillbe displayedetcTheunitsofthisselectorareslicesnotmillimetersthuschanging theresolutionofawarpondemanddatasetusingDatamodecontrolswillchangethe interslicedistanceasdisplayedhereIntheexampleabovetheimagesareslices apartSincethisisintheTalairachviewwhichcanbeseenfromthedatasetnamesin theimageviewertitlebarandthedefaultvoxelsizeofmmwasusedthesesagittal slicesaremmapartcentertocenter.

BorderThiscontrolsthethicknessindatasetpixelsnotscreenpixelsoftheborder todrawbetweensliceimagesIntheaboveexamplethisissetto.

ColorThiscontrolsthecoloroftheborderdrawnbetweensliceimagesIntheabove examplethisissettoagraycolorunderthepresumptionthatyoudonothavea colorPostScriptprinterwithwhichtooutputthismanual.

AcrossthebottomoftheMontcontrolpanelarefouractionbuttonsTheirfunctionsare:

QuitThiswillclosetheMontcontrolpanelandleavethecurrentmontagelayout unchanged.

xThiswillresettheAcrossandDowncontrolstoeachbeThisissimplya convenienceforwhenyouwishtogobacktodisplayingasingleslice.

DrawThiswillinstructtheimageviewingwindowtoredrawitselfascurrentlycommandedThisbuttonwilldisplayininvertedcolorsuntiltheredrawoperationis completeIfthedatasetiswarpondemandandmanyslicesarerequestedthis operationmaytakeseveralseconds)

SetThiscombinesthefunctionsofDrawandQuititwillredrawthewindowas commandedandalsoclosetheMontcontrolpanel.

SlicesaredisplayedstartingintheupperleftcornerthenfromlefttorightthentoptobottomIftheDispcontrolsareusedtorotateormirrortheimagestheseoperationsapply toeachsliceindividuallynottothemontageasawhole.

IfthenumberofslicesdisplayedAcrossDownislargeandSpacingislargethenthe extremeslicesrequestedmaybeoutsidethedatasetInsuchacasethetoggleWrapon theAFNIcontrollerwindownexttotheGapmenucontrolswhathappensIfWrapis turnedonthenslicesrequestedpasttheedgeofthedatasetwillbewrappedbacktothe oppositeedgeIfWrapisturnedothenslicesrequestedpasttheedgeofthedataset willbelledwithzeros.

Theonlysliceimagewhichwillhavecrosshairsdisplayedistheonecontainingthecurrent viewpointClickingmouseButtoninanysliceimagewillcausethecurrentviewpointto jumptothatlocationinthatsliceThiswillalsocausethatslicetojumptothecenter positioninthemontagelayout.

IftheXhairsbuttonissettoMultithenorthogonalimageviewingwindowswillshow crosshairsforeachslicedrawninthemontagedwindow.

TheonlywaythatAFNIprovidestosaveamontagedisplaytodiskistheSaveone functiondescribedearlierThisfunctionasallSavefunctionssavestheimageatits naturalsizeoneoutputpixelperdatasetpixelregardlessofanywindowresizingyou mayhaveimposed.

PopupMenu

IfyouclickandholdmouseButtonusuallytherightmostbuttonwhilethecursorisinan imagewindowamenuwillpopupatthatpointTherstitemonthemenuisJumpback. ThiswillresetthecrosshairviewpointtothelastlocationclickeduponThemainuseof thisfeatureistorecoverfromaccidentallyclickingButtoninaninconvenientlocation.

TheseconditemonthepopupmenuisJumptoThiswillpopupawindowinwhich youmayenterthexyzcoordinatesDICOMorderofthepointtowhichyouwishto setthecrosshairviewpointOneapplicationtheclusterlocationsreportedbydclustmay bepastedintothewindow)

ThethirditemonthepopupmenuisImagedisplayThiswillcollapsetheviewing

windowtojustincludetheimageSelectingthisitemagainwillbringtheviewingwindow

controlsbackOneapplicationmakingsnapshotsofnicefunctionaldisplaysNBThis

functiondoesnotworkwellonallXdisplaysforunknownreasonsItmaycollapsethe

imagewindowtozerosizewhichisslightlyinconvenient. ! WhenallthreeviewingwindowsAxialSagittalandCoronalareopenthebottom Seeingitemonthepopupmenuwillcontainadisplayofthebackgroundpixelvalueatthecenterof

individual voxel values

thecrosshairsThebackgroundisnormallyananatomicalimagebutcanalsobeswitched tobeafunctionalimageusingtheFunctioncontrols)

ResizingImageWindows

Whenaviewingwindowisrstopeneditisatthenaturaldimensionfortheresolutionset intheDatamodecontrolsorinthedatasetheaderleifviewingfromthedatabrickWhen jumpingfromonecoordinatesystemtoanotherorfromonedatasettoanothertheprogram attemptstokeeptheonscreenpixelsmmthesamesothatnosuddenscalechangesoccur.

Whentheviewingwindowsareresizedtheimagesarestretchedbynearestneighbor resamplingThishasnothingtodowiththeresamplingmodessetintheDatamodeand FunctioncontrolsForexamplethecrosshairsareexactlyonepixelthickinthenatural' dimensionofeachwindowIfawindowisstretchedthenthecrosshairswillbecomethicker. Ifawindowisshrunkthecrosshairsmaydisappearwhentheyaremissedduringthe displayresampling.

Whenviewingfromthedatabrickandwhenthedatavoxelsarenotcubicaltheviewing windowswillsimilarlystretchthecoarserdirectiontomaintainthecorrectphysicalaspect ratioonthescreenassumingthattheXpixelsaresquareThiscanproduceablocky lookingimageToforceasmoothingtheWarponDemandmodeshouldbeused.

SampleGraphingWindow

GraphDisplay

WhenthecurrentanatomicaldatasetisDtimeandisnotsettowarpondemandusing theDatamodecontrolsthenthethreeGraphbuttonsnexttotheImagebuttonswillbe activatedTheseallowthedisplayofgraphsofvoxelintensityvstimeAlthoughAFNI

MCWAFNI2.00 { Dec6

graphwindowslookverylikethegraphwindowintheauxiliaryprogramFDthereisat ! leastonemajordierenceAFNIgraphwindowscanberesized)

TheabovegureshowsasamplewithdatatimeseriessubgraphsdisplayedThe

centralsubgraphisborderedinalightcolorhereashadeofgrayThissubgraphisa

plotofthedatatimeseriesattheviewpointvoxeltheonedisplayedatthecrosshairsin

theimageviewingwindowsTheothersubgraphsareofneighboringpixelsinthiscasein

thesagittalplaneInthecorrespondingsagittalviewingwindowthecrosshairswillshow

aboxoutliningthepixelsbeinggraphedIfyoushifttheviewpointinanimageviewer,

thenthegraphviewpointwillshiftaccordingly.

Thevoxelindexesoftheviewpointareshownatthelowerleftedgeofthegraphdisplay�

forexampleZmeansthatthisisslicenumbercountingfromThenthespacing

betweenverticalgridlinesintimestepsisshowninthiscasethereisagridlineeveryth

timestepTheNumlabelshowsthenumberofpointsinthetimeseriesAtthebottomof

thegraphsisalabelstartingwithindexThisshowsthetimeindexofthecurrentpoint

whichcanbealteredwiththeIndexcontrolontheAFNIcontrollerwindowthevalue

ofthetimeseriesatthatpointandthetimecoordinateofthattimeindexinthiscase,

secondsThecurrenttimepointisdisplayedwithalittleredballoverlaidnthe

centralsubgraphinthegureaboveredisrenderedingray. ! Attheleftofthegraphsaretwonumericlabelsinthiscaseand. GraphThisshowstheverticalrangeofthecentralsubgraphInthisdisplayeachsubgraph

scaling

hasitsminimumpointatthebottomofitssubwindowEverysubgraphhasthesame verticalscalefactorbuthasadierentverticalosetThisissothattheywillalltinthe samedisplayeasilyThiscanbeconfusingwhencomparinglevelsofadjacentpixelsitis importanttorealizethattherecanbeanarbitraryconstantosetbetweenadjacentsubgraphsTheBaselinebuttonontheOptmenucanbeusedtoensurethatallsubgraphs areplottedwiththesameverticaloset.

ButtonClicksinaGraph

Atthelowerleftofthegraphwindowisalogowhosemainfunctionistoremindyoufrom whichplanethesegraphsaredrawnThiscanbesuppressedforwindowsnapshotpurposes) byclickingButtononthelogoClickingButtoninthatspaceagainwillrestorethelogo. TheFIMandOptbuttonswillalsobehiddenandrestoredbytheseoperations)

ClickingButtononthecentralsubgraphwillcausethetimeindextojumptothat pointIftheShiftorCtrlkeyispressedwhiledoingthisthetimeindexinsteadwill moveupordownbyinwhicheverdirectioncorrespondstothemousecursorrelativeto thetimeindexindicatorball.

ClickingButtononanyothersubgraphwillcausethespatialviewpointtojumptothat locationwithoutchangingthetimeindexClickingButtononasubgraphwillpopupa smallwindowwithsomestatisticsaboutthattimeseries.

Somekeystrokesifpressedwhilethegraphwindowhasfocuswillcarryoutcertain functionsThesefunctionsarealsoavailablefromtheOptmenuandaredescribedbelow.

MCWAFNI2.00 { Dec6

GraphingFIMleftandOptrightmenus

Optmenu

Theitemsonthismenucontroltheappearanceofthegraphs:

ScaleThisisapullrightmenuusedtocontroltheverticalscaleofthegraphsThe gureaboveshowsthesubmenuthatresultsfrompullingrightonthisitemThe DownandUpbuttonswillcausethegraphstoscaledownshrinkandupgrow. PressingthekeysandinthegraphwindowwillhavethesameeectsThe Choosebuttonwillcausealittlechoosertopopupwhichallowsyousetthevertical scalefactormanuallyIfthescalefactorispositivethenitisthenumberofscreen pixelstouseperunitofdataIfthescalefactorisnegativeitsabsolutevalueisthe numberofunitsofdataperscreenpixelThusincreasingthescalefactorwillcause thegraphtogrowverticallyThereisnoprovisioninAFNIforautomaticscalingto tthedatasetrangeeachgraphwindowstartswithitsscalefactorsettoJudicious useoftheorkeysmaybeneededtomakeagraphvisible.

MatrixThispullrightmenuisusedtocontrolthenumberofsubgraphsdisplayedIt showsasubmenusimilartotheScalesubmenuInthiscaseDownkeystrokem) willcausethenumberofsubgraphsdisplayedacrossanddowntodecreasebyUp keystrokeMwillincreasethearraysizebyChoosewillletyoudirectlysetthe numberofsubgraphs.

GridThispullrightmenuletsyoucontrolthespacingintimestepsbetweenvertical gridlines.

SliceThispullrightmenuletsyoumovethespatialviewpointbetweenslicesinthe datasetmovingwithinasliceiscontrolledbyButtonclicksasdescribedabove.

GridColorThisitemjustrotatestheverticalgridcolorbetweentheavailablechoices.

MCWAFNI2.00 { Dec6

BaselineThisitemswitchesthewaythatgraphbaselinesarecomputedBydefault, eachsubgraphhastheminimumvalueofitstimeseriesmappedtothebottomof itssubwindowBypressingthisitemorthebkeythesubgraphswillswitchto havingacommonbaselineThatistheminimumvalueinallthedisplayedtime serieswillmappedtothebottomofeachsubwindowInmanycasesdoingthiswill requirescalingdownthegraphswiththekeyChoosingthisitemagainwillrestore theoriginalgraphbaselinemode.

WriteCenterSelectingthisitemorpressingthewkeywillwritethedatasettime seriesinthecentralsubgraphtodiskinalenamelikesuffixDThe suffixisselectedbythenextmenuitemSetwSuffixandtheprexnumbers arefromthevoxelspatialindexinthedatasetTheoutputleisASCIIonenumber perlineNBtheoutputisthedatasettimeseriesandisunaectedbytheTran transformationsbelow)

TranDThisitemisthesameastheTranDitemontheimageviewerDisppanelIt allowstheapplicationofapointwisetransformationfunctiontothetimeseriesbefore graphingoccurs.

TranDThisitemallowstheapplicationofgeneraltransformationstothetimeseries beforegraphingThetwobuiltinTranDfunctionsareMedianandOSfilt, whichareorderstatisticssmoothingltersusingawideneighborhoodInaddition, thepluglsqfitplugindenestwomorefunctionswhichcanbeusedtodolinear leastsquarestsofvariousfunctionstodatasettimeseries)

DoublePlotNormallyifaTranDtransformationisappliedthegraphofthetransformeddatareplacesthegraphoftheoriginaldataIfthisitemisselectedthenboth graphswillbedisplayedThiswasaddedtobeabletoseetheleastsquarestsfrom pluglsqfitplottedovertheinputdata)

DoneThisclosesthegraphingwindowthekeystrokeqhasthesameeect.

FIMmenu

Thismenuisusedtocontrolthecomputationoffunctionaldatasetsoftheficotypefrom DtimedatasetsSomeofthefunctionsofthismenuareduplicatedontheFunction controlpanelFIMmenu.

TheoryofFIM

Ifxnisadatatimeseriesandrnisaknownreferenceoridealvectorcorrespondingtothe expectedactivationtimecoursethenthestatisticalmodelforxnis

xnrabnn n) nNiid.

n

whereistheunknownamplitudeoftheactivationaistheunknownmeansignallevel, bistheunknownlineardriftintimeandistheunknownnoisevarianceThecorrelation

MCWAFNI2.00 { Dec6

methodcomputesthesamplecorrelationcoecientbetweenxnandrnandusesthat todeterminethesignicanceofthehypothesisthat

.

TimeSeriesFiles

MCWAFNIstoressingletimeseriessuchasrnintheformatdescribedearlierASCII formatonenumberperlineAnumbergreaterthanmeansthatparticularpoint intimeshouldbeignoredThisconventiongoesbacktotheoriginalmprogramin, andisduetoAndrzejJesmanowiczofMCWTheWriteCenterbuttondescribedabove isonewaytocreatesuchatimeseriesleAnotheriswiththeauxiliaryprogramsqwave. Yetanotherissimplytouseatexteditorsuchasvi)

WhenAFNIstartsupitwillreadintimeserieslesfromthesessiondirectoriesthat itopensTheprogramwillattempttoreadatimeseriesfromanylewhosenameends inDThesetimeserieswillbepooledintoalibrarywhoseentriescanbeselected fromamenuasdescribedbelow.

Youmaywishtokeepsometimeserieslesstoredseparatelyfromanyparticularsession directoryAFNIcanbemadetoreadsuchlesbydeningtheshellenvironmentvariable AFNITSPATHLiketheexecutablesvariablePATHthisisacolonseparatedlistofdirectories inwhichtosearchforparticularlesinthiscaseDlesForexample:

setenvAFNITSPATHfHOMEgtimeseries/

willcauseAFNItosearchfortimeseriesinthetimeseriesdirectoryunderyourhome directoryandinthecurrentworkingdirectoryNormallyyouwouldputthistypeof commandinyourcshrclesothatitwouldalwaysbeexecutedwhenyouloginIm assumingthatyouusetheCshellcshoritssupersettcsh)

IsaidabovethattimeserieslesarestoredasonenumberperlineThisistrueofthe olderprogramssuchasmFDetcbutAFNIitselfallowsmorethanonenumberper lineInthiswaymorethanonetimeseriescanbestoredperle:

9
9
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
. . . .

TheaboveexampledenesfourtimeseriesinoneleEachonestartswithtwos, whichindicatesthatthesetwopointsshouldnotbeusedinanyanalysiswiththesetime seriesThesubsequentvaluescouldbeusedasanidealwaveforminFIManalysisInthis exampleeachtimeseriesaftertherstisatimedelayedcopyoftheonetotheleftAUnix commandoftheform

prmtsaDbDcDdDabcdDx

canbeusedtogluemultiplelestogetherhorizontallyintoasinglelewithmultiple columnsYoushouldbesurethatalltheleshavethesamenumberoflinesbeforeusing theprcommandwhichisreallyaprogramdesignedforformattinglesforprintoutOn SGIworkstationstheprcommandhasasmallupperlimittothenumberofcolumnsitwill outputOnsuchsystemsitmaybenecessarytopasteupalargenumberofcolumns intwostages)

Toallowsuchtimeserieslestobedistinguishedfromordinarylescontainingonly onetimeseriesAFNIallowstheuseofthelenamesuxDxasintheprcommand exampleaboveHoweverthereisnodierencebetweentheDxlesandtheDles asfarasAFNIisconcerneditisperfectlyacceptabletohaveamulticolumntimeseries lenameendinDortohaveasinglecolumntimeserieslenameendinDx.

AtthisreleaseonlytheactualAFNIprogramwillrecognizethesemulticolumntime serieslescorrectlyOtherprogramssuchasmstillrequireeachletocontainonly onetimeseries.

Sampletimeserieschoosermenu

FIMMenuItems

PickIdealThisbuttonpopsupachooserwindowwhichallowsyoutoselectatime seriesletobeusedastheidealwaveformrnanexampleofthischooserisshown aboveWitheachtimeserieslenameisshownthedimensionsofthetimeseries. IntheexampletheleqqqDxhaspointsintimelinesofdataandhas3 columns.

IftheidealtimeserieshasmorethanonecolumntheFIMcomputationscomputethe correlationcoecientofeachvoxelwitheachcolumnseparatelyThenthecolumn thatismosthighlycorrelatedwiththevoxeltimeseriesisselectedtocomputethe� forthatvoxelbecomestheintensityandthecorrelationcoecientbecomesthe secondsubbrickstoredintheresultingficodataset.

WhentheidealtimeseriesisselecteditwillbeplottedatthetopofthecentersubgraphwindowinredSectionsofitthataremarkedtobeignoredwillbeplottedin blueIfthereismorethanonecolumnintheidealtimeseriesbydefaulttheywillall beplotted.

BythewaythePlotbuttononthetimeserieschooserispermanentlydeactivated. Iintendedtoprovidetheabilitytopreviewatimeseriesinalittlewindowbutnever gotaroundtoimplementingitThebuttonremainstoremindmeofthisandto remindmeofallmyothergoalsforAFNIthathaveyettocometofruition)

PickOrtInthemathematicalmodelforxngivenearliernotethatweincludedabnin themodeltorepresenttheunknownbaselineanddriftofthedatatimeseriesThese areortstimeseriestowhichthedatatimeseriesisorthogonalizedpriortothe correlationcoecientcalculationAFNIalwaysorthogonalizesthedatatothese twotimeseriesInadditionyoumayspecifyanothertimeseriestowhichthedata timeseriesineachvoxelshouldbeorthogonalizedIftheorttimeserieshasmorethan onecolumneachdatatimeserieswillbeorthogonalizedtoallcolumnspriortothe correlationcoecientcalculation.

WhentheorttimeseriesisselecteditwillbeplottedinthemiddleofthecentersubgraphwindowingreenSectionsofitthataremarkedtobeignoredwillbeplotted inblue.

EditIdealThispullrightsubmenushowninagurefaraboveisusedtocontrolthe idealwaveformThemenusubitemsare:

IdealCenterwilltakethecentralsubgraphdatatimeseriesandmakeitthe idealtimeseries.

IdealCenterwilltakethecentralsubgraphdatatimeseriesandaverageit intotheidealtimeseriesInthiswayitispossibletoselectagroupofvoxels oneatatimeandaveragethemtogethertomakeasinglewaveform.

SmoothIdealwillapplyaneighborhoodorderstatisticsltertosmooththe currentidealwaveformIfthepointsinputareabandcthentheoutputis

ynmedianabcmaxabcminabc:

ShiftIdealwillpopupacontrolpanelthatallowsyoutogenerateshiftedcopies ofthecurrentidealwaveformAlltheshiftedcopiesformamulticolumntime seriesInthiswayitispossibletoconstructasinglecolumnidealwaveformuse AFNItocreatetimeshiftedcopiesofitandthencorrelatethemallwiththe datapickingoutthebesttimeshiftateachvoxel.

ClearIdealwillclearthecurrentidealwaveformthatistheidealwaveform willbeundenedafterthisispressedThegraphoftheidealwaveformwillalso becleared.

ClearOrtwillclearthecurrentortwaveform.

ReadIdealallowsyoutoreadintheidealwaveformfromanexternalle.

WriteIdealallowsyoutowritethecurrentidealwaveformtodiskInthisway, anidealcreatedfromthecurrentdatasetcanbesavedforlateranalysis.

StoreIdealallowsyoutostorethecurrentidealwaveformintotheAFNImenu forpossiblelaterselectionTheonlywaytocreateanortfromadatasetisto rstcreateitasanidealthentostoreitwiththisbuttonandthentouse

PickOrttogetitothetimeseriesmenuTheWriteandStoreoperations areindependentwritingtodiskdoesnotimplystoringinthemenusystemor viceversa.

IgnoreThispullrightmenuallowsyousetthenumberofpointstobeignoredatthe beginningofeachtimeseriesThisisoftendesirablesinceinrapidscanMRIthe longitudinalmagnetizationmaytakeseveralimagestoreachsteadystateTimepoints thatareignoredeitherthroughtheuseofthiscontrolorlargevaluesinthe idealwaveformwillbeskippedinthecorrelationanalysisInadditionpointsthat areignoredwiththiscontrolwillnotbegraphedThisallowslargeinitialtransients tobesuppressedandmakesiteasiertoreadthegraphs.

FIMPlotsThispullrightmenuallowsyoutospecifywhetherallthecolumnsoftheideal andortwaveformsshouldbeplottedorjusttherstcolumns.

ComputeFIMThiswillstartthecorrelationcalculationsAttheleastanidealwaveform mustbespeciedbeforethisbuttonwillworkYoumayalsowishtosettheIgnore valueandtheortwaveformpriortothesecomputations.

ThecalculationsusetherecursivemethodofCoxetalWhiletheyareproceeding, aprogressmeterwilldisplayoverthetitlebaroftheAFNIcontrollerwindowWhen theresultsarenishedthenewficodatasetwillbecomethecurrentfunctional datasetandcanbeexaminedimmediatelyintheimageviewersIftheinputDtime datasetwerenamedelvisorigthentheficodatasetwillbenamedelvisorig, wherewillbeoneofIfdesiredtheDatasetRenameplugrenamec) plugincanbeusedtochangetheprextosomethingmoreconvenient.

ViewingControls

ThesecondcolumnoftheAFNIcontrolwindowcontainsmanycontrolsthataecthowthe datasetsareviewedtransformedandoutput.

ViewModes

AtthetopofthissecondcolumnaretheviewmodecontrolsTheseletyouswitchbetween theavailableviewsOriginalACPCalignedorTalairachIfaparticularviewisnot availableforthecurrentlyactiveanatomicaldatasetthenthecorrespondingbuttonwill beinactivegrayedout.

WhenyouswitchviewmodesyouwillseethatthewindowschangesizeThatisbecause intheacpcandtlrcviewstheimagesareclippedtotheknowndimensionsofhuman

MCWAFNI2.00 { Dec6

headsThisistosavespacewhensuchdatasetsarewrittentodiskThewindowresizing issetuptopreservethepixelsperbrainmillimeterratioTheprogramalsoattemptsto keepthecrosshairviewpointinthesameanatomicallocationastheywereintheprevious viewmodebuttheymayshiftslightlySincetheorigviewwillgenerallyberotatedfrom theacpcandtlrcviewskeepingtheviewpointatthesamelocationdoesnotmean keepingtheslicesinthesamelocation.

DefineControls

EachDefinebuttonopensupanothercontrolpaneltotherightofthissecondcolumn. TheyarediscussedseparatelylaterNotethattocloseaDefinecontrolpanelyoupressits buttonagainTohelpwiththistheDefinebuttonsthatarecurrentlyopenaredisplayed ininvertedcolorsYoumayopenmorethanoneDefinecontrolpanelatatimebutthey willalllieontopofeachothermostrecentlyopenedpanelontop.

SwitchControls

Thesecontrolsletyouchoosewhichsessionandwhichdatasetsfromthatsessionyouare viewingatanygivenmomentTheypopupachooserthatletsyoucyclebetweenthesession directoriestheanatomicaldatasetprexesandthefunctionaldatasetprexesrespectively.

WhenyouswitchdatasetsAFNImaybeforcedtoswitchviewsaswellThiscanoccurif thenewdatasetdoesntexistintheviewmodeyouwereformerlyinForexampleifyousave severalfunctionaldatasetsintheTalairachviewmodeusingtheDatamodecontrolsthen combinethemwithdmergetheresultwillonlyexistinthetlrcviewYoucanonlyview thisfunctionaldatasetwhentheviewmodecorrespondssotheprogramwilljumptothat modeIfsuchaviewmodeswitchoccurstheprogramwillbeepwhenitmakesthetransition.

DefineMarkers

ThetransformationtotheACPCalignedviewandfromtheretotheTalairachviewis accomplishedbymeansofmarkersTheseareanatomicallandmarksthatyoumanually selectusingthecontrolcolumnopenedupbythiscontrol.

OnlyDanatomicaldatasetscanhavemarkerssetDtimedatasetshavethemarkers disabledItisonlypossibletotransformaDtimedatasettoTalairachcoordinatesusing aparentDdatasetasdescribedearliertheXsandOsdiagram.

MarkersfortheACPCAlignedTransformation

TheACPCalignedviewmodeisdenedbyarigidbodytransformationthatmakesthe ACPClinethenewyaxismakesthelongitudinalssurethenewxzplaneandmakes thelineperpendiculartothatthenewxaxisrighttoleftTheneworiginisputatthe intersectionoftheACPClineandtheverticallinepassingthroughtheposteriormargin oftheACSeefordetails.

Cartoonofcentralbrainshowingkeyanatomicallocations

ToselectthelandmarksyoumustrstchooseAlloweditssothatAFNIwillletyou changethemarkersAfterthatyouchoosethevelandmarks:

ACsuperioredgeThehighestpointontheanteriorcommissureinthemidsagittal plane.

ACposteriormarginTherearmostpointontheanteriorcommissureinthemidsagittalplane.

PCinferioredgeThelowestpointontheposteriorcommissureinthemidsagittal plane.

FirstmidsagptTwopointsarerequiredinthelongitudinalssuretheyareused todenethenewzaxisTwopointsarerequiredtomakesurethatthenewvertical planeisdenedadequatelythemismatchbetweentheACPClineandthesetwo pointsmustbelessthan)

AnothermidsagptShouldbeatleastmmawayfromtherstone.

OriginalleftandACPCAlignedrightDefineMarkersControlPanels

Youselectalandmarkbydepressingitsbuttonthenmovingthecrosshairstothedesired locationthenclickingtheSetbuttonAvisiblemarkerwillappearYoucanresetthis pointorClearitWhenamarkerissetitstogglebuttonwillappearininvertedcolors.

TheatlasdenitionsofthemarkerlocationsarealwaysintermsofaboundaryThat

isslightlyambiguouswhenitcomestodiscreteimagesdoyoumarkthelastvoxelvisible

inthestructureortherstvoxeljustoutsidethestructureMyarbitrarysolutiontothis

problemisalwaystomarkthelastvoxelvisibleinthestructureForexampleinmarking

thetopoftheACImoveupuntilitisjustnolongervisibleintheaxialimageThen ! IdropbackdownoneaxialsliceItispossibletousewarpondemandtoplacemarkers

Subvoxel

atsubvoxellocationsseetheDatamodecontrols.

marker locations OnMRimageswithmmvoxelsandwithgoodgraywhitemattercontrastitisusually

quiteeasytosettheACmarkersAtMCWweuseaGESignaSPGRsequenceforthis

purposeThePCishardertospotbutitisalwaysnearthetopofthecerebralaqueduct

insubjectswithnormalanatomyitmightbedisplacedbysomepathologicalconditions�

ifyoususpectthishashappenedconsultaneuroradiologistimmediatelyExamination

ofthesampleAFNIdatasetandsomeconsultationwithaneuroanatomytextbookwill

probablybehelpfulinlearningtorecognizetherequiredanatomicallandmarks.

MakingtheTransformation

WhenallmarkersaresettheQualitybuttonwillbecomeactiveThisbuttonwillcheck themarkersetforelementaryconsistencyIfthemarkersdontpassthetestanerrormessage popsuptoexplainwhathappenedIftheydopassthetestthentheTransformData buttonbecomesactiveWhenyoupressthisthenewdatasetwillbecreatedinthiscase, theacpcviewoftheanatomicaldatasetyouwerejustmarkering.

ThisnewdatasetwillnothaveaBRIKleondiskjustaHEADleWhenAFNIcomes todisplaythisdatasetitwillsimplytransformtheneededdatafromtheorigdataset. IfyouwishyoumaysavethedatavoxelsinthenewviewtodiskusingtheDatamode controlsIfyouwishtomanipulateatransformeddatasetusingtheauxiliaryprograms, youwillhavetosavethedatavoxelstodisk)

TransformationtoStereotaxicieTalairachCoordinates

AfteryoucreatetheACPCalignedviewyoucanswitchtoitwiththeACPCAligned buttonAtthispointyoucansetmarkersforthescalingtotheTalairachviewSixmarkers arerequiredtodenetheboundingboxofthecerebralcortexTheseshouldbesetquite carefullysinceitisofteneasytomistakethesagittalsinusforcortexwhichwouldgivean erroneouslylargeboxinthezdirectionGenerallyIndthatthemostinferiorpointin oneofthetemporallobesisthehardesttopickout.

Intheacpctlrctransformationmarkercontrolpanelatoggleswitchlabeled BigTalairachBoxappearsjustbelowtheTransformDatabuttonIntheearliestversionsofAFNIthebraindatawasclippedatmminferiortotheACPClinethisbeing thelocationofthebottomoftheTalairachTournouxatlasguresInsubsequentworkwe foundthiswasinadequateforcerebellarimagingThenewdefaultclippinglevelismm

MCWAFNI2.00 { Dec6

inferiortotheACPClineandthisisreferredtoastheBigTalairachBoxDatasets BRIKscreatedwiththeoldsmallboxsizearesmallerthanthenewboxsizeThereisno waytomixoldandnewboxsizedatasetstogetherwhenusingtheauxiliaryanalysisprograms suchasdANOVAForthisreasonandtomaintaincompatibilitywitholdanalysesitis possibletowriteoutoldboxsizedatasetBRIKsbytogglingthisswitchoForallfuture workIstronglyrecommendusingthenewTalairachboxsize.

ThetransformationcarriedoutispreciselytheonedescribedinandIrecommend thatanyoneusingAFNIreadthisatlasThedatasetisdividedintosubvolumes:

InxRighttoMidsagittalMidsagittaltoLeft

InyAnteriortoACACtoPCPCtoPosterior

InzInferiortoACACtoSuperior

Eachregionisscaledseparatelytomatchthemillimetriccoordinatesintheatlas:

xaxisACPClinetomostleftpointofcerebrummm

xaxisACPClinetomostrightpointofcerebrummm

yaxisMostanteriorpointofcerebrumtoACmm

yaxisACtoPCmm

yaxisPCtomostposteriorpointofcerebrummm

zaxisMostinferiorpointofcerebrumtoACPClinemm

zaxisACPClinetomostsuperiorpointofcerebrummm Theatlasbrainisfromanadultfemaleandsoatypicaladultmalebrainwillbeslightly compressedbythesestandardmeasurementsAnyjokesatthispointwillbesternlydealt withThistransformationisthencombinedwiththeorigacpctransformationso thatthedataviewedintheTalairachmodeisonlyinterpolatedoncenottwice.

Thewholeproceduretoproducethetlrcviewfromtheorigviewonlytakesafew momentsonceyoubecomeadeptatrecognizingtherequisiteanatomicallandmarks.

Youwillndthatthemarkertogglebuttonsandsetclearbuttonsareduplicatedonthe popupmenufromtheimagingwindowsThisisforconveniencesinceitisoftennecessary topeercloselyatthescreentodecideonamarkerpointandIpersonallynditannoyingto havetoswitchmyattentiontoanotherwindowinordertosetthemarkerAlsonotethat depressingthetogglebuttoninthemarkercontrolcolumnoronthepopupmenuforan alreadysetmarkerwillcauseAFNItojumpthecrosshairviewpointtothatmarkerlocation.

FinallynotethattherearenomarkersavailabletobesetintheTalairachviewmode. Atpresenttherearenotransformationsbeyondthisonemaybesomeday.

RetransformationandRecreationofDatasets

Ifyoudecidetoremarkandretransformananatomicaldatasetthentheoldtransformed versionwillbedeletedfromdiskbeforethenewversionismadeNotonlythatbutall theautomaticallymanufacturedtransformeddatasetsthatfollowonthistransformation willalsobedestroyedandremadeThiscanbedisconcertingatrstbutitistheonly logicalcourseofactionforAFNItotakeotherwisethetransformedfunctionaldatasets

MCWAFNI2.00 { Dec6

wouldhavebeenmadewithadierenttransformationthanthenewanatomicaldataset onwhichtheywillbeoverlaid.

Theonlytimethisdestructionisinappropriateiswhenthefunctionaldatasetsinthe transformedviewarenotinfacttransformationsfromoriginaldatasetsinthesamesession. Thiscouldhappenifyoucopiedatlrcdatasetintoasessionfromanotherdirectoryor ifyoucreatedatlrcdatasetusingdmergesayAFNIwillnotdeleteadatasetifthere isnoparentdatasetfromwhichitwaswarped.

AFNIwillnotletyoumarkandtransformmorethanoneanatomicaldatasetpersession. Onceyouhavetransformedonedatasetinasessiontheotherswillbeolimitstodirect markingandtransformationTheirtransformationswillbederivedfromthemasterdataset thatyoumarkrst.

DefineFunctionandDefineDatamodecontrolpanels

DefineFunction

Thebuttonsandotherwidgetsonthiscontrolpanelareusedtomanipulatehowfunctional datasetsaredisplayedintheviewerwindows.

ThresholdSlider

Ifthecurrentfunctionaldatasethasathresholddatasubbrickieisnotofthefimtype, thentherstitemintheFunctioncontrolpanelisasliderthatletsyouselectthethresholdto applyOnlyvoxelswhoseassociatedvalueisequaltoorabovethisthresholdwillbeoverlaid incolorIfthefunctionaldatasettypeisficofittorfiftthenAFNIknowshowto interpretthethresholdlevelintermsofthestandardnormalmodelsforthesestatistics, andwillshowthecorrespondingpvaluepervoxeljustbelowthesliderThedataset thresholdtypeisshownatthetopoftheslider.

IfthefunctionaldatasetisofthefimtypethenthissliderwillnotbevisibleInthis casetheleftmostitemintheFunctionpanelwillbe:

ColorPbar

Themulticoloredverticalbarwithnumericallabelstotherightandanumberselector labeledbelowiscalledthepbarafteritsnameintheCcodeThisdevicecontrols thecolorsforthefunctionaloverlay.

Thenumberselectorbeneaththepbarcontrolhowmanycolorpanesarepresentfrom toareavailablethedefaultinAFNIissettopanesJustbelowthatisatoggle switchPosThisallowsyoutospecifythatonlypositivevalueswilltheshowninthecolor pbarorthatbothpositiveandnegativevalueswillbeshownSomefunctionaldatasetsare naturallynonnegativefortheseallocatingcolorstothenegativerangeispointless)

ThecolorinanypanemaybealteredbyclickinginsidethepaneitselfAchooserwill thenpopuptoletyouselectfromtheavailablepalettewhichishardcodedintoAFNIand canonlybechangedviatheXdefaultsleOnecolorchoiceisnonewhichmeansthat nocolorwilldisplayforthatrangeoffunctionalintensitieseveniftheyappearinvoxels thatareovertheselectedthreshold.

EachcolorpaneappliestotheindicatedrangeoffunctionalintensitiesTheseintensities arerelativetotheRangecontrolsettingstothelowerrightTheRangesettingisismapped toonthepbarandallotherpbarsettingscorrespondtothesimilarlyscaledvalues inthefunctionaldatasetsubbrickbeingviewedYoumayclickanddragonthesashes' betweenthecolorpanestochangetheintensitythresholds.

Options

TheoptionscolumnisagrabbagoffunctionaldatasetstuTherstboxedsetofbuttons Anatunderlayetcletsyouchoosewhethertheanatomicaldatasetorthefunctional datasetappearsasthebackgroundgrayscaleimagesintheviewingwindowsThesecond boxedsetFuncIntensityetcletsyouchoosebetweendisplayingtheintensityorthe thresholdasthecolordeterminingfunction.

ThethirdboxedsetcomprisedtherangecontrolsforthefunctionalcoloringAtthetop aretheminimumandmaximumvaluesfoundinthecurrentdatasetscfauxiliaryprogram xxxx

dinfoThenextcontrolisatogglelabeledautoRangeThevaluerepresented byxxxxistheautomaticallyassignedrangeforthefunctionalrangewhichcorrespondsto onthepbarThisautoRangeischosenbyAFNIasthelargestabsolutevalueinthe datasetsubbrickIfthetoggleisothenthecontrolbelowisactivatedandallowsyou tospecifythefunctionalvaluethatmapstoonthepbarControllingthisrangemay bedesirablewhencomparingseveraldatasets.

ThelowestsofarcontrolinthiscolumnprovidesanotherFIMmenubuttonseethe GraphsectionThelabeltotherightofthisbuttonshowsthedatasetthatwillbeprocessed oncetheComputeFIMbuttonispressed.

DefineDatamode
ThiscontrolcolumndetermineshowdatasetsaremanipulatedbyAFNIItalsocontains
somemiscellaneouscontrolsthatdidnttinelsewhere.
Resampling
! Thetopboxedsetofcontrolsletsyouchoosehowtheanatomicaldatathatisactuallydis
WarpondemandplayedwillbegeneratedYoucanviewthedatadirectlyfromtheBRIKleifitisavailable.
subvoxel Inthiscaseyouarelimitedtoseeingthedatasetatthevoxelresolutionatwhichthedata
markers wasgeneratedAlternativelyyoucanchooseWarpAnatonDemandviewingwhichmeans
thatthedatawillbeinterpolatedfromitssourcetowhateverresolutionyouorderusing
thecontrolsjustbelowInthiswayitispossibletoplacemarkersatsubvoxellocations.
AtpresentAFNIcannotdisplaygraphsfromawarpondemanddatasetIfyoutakean
actionthatcausesaDtimedatasettobeswitchedtowarpondemandmodethenany
opengraphwindowswillbedestroyedThiswillhappenforexampleifyouswitchfrom
origtotlrcviewandhavenotyetwrittentheDtimedatasettodisk.
! TheinterpolationmodesarenearestneighborNNlinearLicubicCuandblocky'
Resampling modesBkthislatterisintendedmainlyforfunctionaldatasetsandisintermediatebetweenNN
andLiitsmathematicaldenitionisattheendofthismanualNNLiandBkarefairly
rapidonadecentworkstationbutCucanbenoticeablyslowSinceitusesneighboring
gridpointstointerpolatevsforLiandBkanditusesmorecomplexformulasthisis
understandableFormostpurposesLiinterpolationforanatomicalimagesandBkinterpo
lationforfunctionalimageswillbethebestNBthresholddatainfunctionaldatasets
isalwaysresampledusingtheNNmodeThisisbecauseitissomewhatunreasonableto
interpolateanonlinearstatisticsuchascorrelationcoecientbetweenvoxelsandthento
interpretthisstatisticusingprobabilisticmodelsthatassumeindependence.
ThesmallestresolutionallowedbytheResammmselectorismmThisisvery
tinyandimageswilldisplayveryslowlyYoucandoitifyouwishhoweverdonttryto
writeoutawholehumanheaddatasettodiskatthisresolutionThediskspacerequired
wouldberatherlarge.
ControlsfordeterminingwhetherthefunctionaldatasetBRIKifavailableorwarp
ondemandwillbeusedforcomputingthefunctionalslicesarethenextsetdownThe
functionalBRIKcanbeusedonlyifitactuallyexistsinthecurrentviewiecoordinate
systemandifitisatthesamespatialresolutionastheanatomicaldatasetbeingviewed.
DatasetOutputandInput
TheWritebuttonswillcomputeandwritetheBRIKlestodiskfortheindicateddatasets.
ThecurrentresamplingmodeandresamplingdimensionwillbeusedforthispurposeThe
AnatbuttonwilloutputthecurrentanatomicaldatasettheFuncbuttonoutputsthe
currentfunctionaldatasetTheManybuttonallowsyoutoselectmorethanonedataset
fromallsessionsandwritethemalloutThisnewcontrolisprovidedsincetheresampling
processcanberelativelyslownowyoucanselectmanydatasetsstarttheiroutputin
TalairachcoordinatesandthengogetsomethinggoodtoeatwhileAFNIchurnsaway.
MCWAFNI2.00 { Dec6

! AFNIwillnotwriteoveradatasetBRIKwhichcannotberecreatedbywarpingfroma

parentThisprecautiondoesnotextendtopluginswhichcanbewrittensoastodestroy

unrecoverableBRIKsItispossibletouseAFNItoresampleadatasetintheorigview,

butonlyifthedatasetiswarpondemandfromanotherdatasetasparentThiscanbe

arrangedusingtheddupauxiliaryprogram.

TheRescanbuttonsaredesignedtorereaddatafromdiskTherstoneThiswill rereadthecurrentsessionThisisusefulifyouuseanauxiliaryprogramsuchasdANOVA tocreateanewdatasetoutsideofAFNIandthenwishtoviewitInearlierversionsit wasnecessarytoexitAFNIandrestartittogetnewdatasetsintotheprogramTheAll buttonwillrereadallthesessionsthatwereinitiallyloadedthereisnofacilitytoreadin anentirenewsessionatthistimeFinallytheDbuttonwillrereadthetimeseries directoriesandloadanynewtimeserieslesthatarefound.

ControllerLock

WiththeNewbuttonlowerleftofAFNIcontrollerwindowitispossibletoviewseveral datasetsatonceinseveralsetsofviewingandgraphingwindowsNormallytheviewpointsoftheseparatecontrollersareindependentthatisclickinginthesagittalwindowof controllerAwillchangetheviewpointofAscoronalandaxialwindowsbutwillhave noeectonBsimageandgraphwindows.

Undersomecircumstancesyoumaywishtolocksomecontrollerstogethersothattheir viewerwindowsmoveinunisonThiscanbedonewiththeLockmenuThereisonlyone lockinAFNIThismenudetermineswhichcontrollerwindowsparticipateinthelockIf thespatialviewpointischangedinanywindowthatisaectedbythelockthenAFNIwill attempttojumpallotherlockedwindowstothecorrespondingviewpoint.

InadditiontheLockmenuhasaClearbuttontodetachallcontrollersfromthelock, andanEnforcebuttonwhichcanbeusedtomakeallviewerwindowsaectedjump tothelockedpositionEnforceisonlyneededjustafterchoosingwhichcontrollersto belockedtogether)

Acoupleofapplicationsforthelock:

ScrollingthroughseveralanatomiesinTalairachcoordinatessimultaneouslyviewing

Trythis

thesimilaritiesanddierences.

ViewingadatasetinOriginalandTalairachcoordinatessimultaneously.

Comparingseveraldierentfunctionaldatasetsoverlaidonthesameanatomy.

AFNIcanhavetroublewhenthelockisusedbetweencontrollersindierentcoordinatesystemsThelocksubroutinewillworkproperlyifthedatasetbeingviewedinonecontrolleris justtherealizationoftheothercontrollersdatasetinadierentcoordinatesystemitwill carryouttheTalairachtransformationoritsinverseasneededtokeepthelockanatomically reasonableItwillfailifthetwocontrollershavedierentcoordinatesystemsanddierent datasetsforexampleitdoesntknowhowtotransformfromTalairachcoordinatesinone datasettoOriginalcoordinatesinanotherdataset.

Plugins

ThelastitemintheDatamodecontrolpanelisthePluginsmenubuttonThiswillonly bepresentifAFNIiscompiledwithpluginsupportandiftheprogramndsatleast onepluginwhenitstartsup.

PluginsareexternalCfunctionswritteninconformancewiththepluginsmanualthat provideextrafunctionalitytoAFNITheyarecompiledintosharedobjectsorshared librarieswiththelenamesuxsoorslonHPUXAFNIsearchesforthemina setofdirectoriesspeciedintheshellenvironmentvariableAFNIPLUGINPATHIfthisisnot denedthenPATHisusedthatwaystoringthecompiledpluginsinthesameplaceasthe MCWAFNIexecutableswillwork.

EachpluginwillcreateoneormoreinterfacepanelsWhenyouselectapluginfrom thePluginsmenuitsinterfacepanelwillpopupAtthatpointyoullinthedesired parametersandthenexecutetheactualplugincodewithoneoftheRunbuttons.

Clusteringpluginplugclustcinterfacepanel

Commandlineswitc hes

ThegeneralformfortheAFNIcommandlineis

afnioptionssessiondirectory]

wheretheoptionslistedbelowallstartwiththecharacterIfnosessiondirectoriesare enteredthentheprogramactsasiftheuserhadtypedforthesessionwhichmeans thatthecurrentworkingdirectorywillbescannedfordatasets.

WhatIconsidertobethemoreusefuloptionsarelistedbelowAcompletelistcanbe foundbyenteringthecommandafnihelp.

purge

ConservesmemorybypurgingdatasetstodiskwhennotinuseUsethisifyourunout ofmemorywhenrunningAFNIThiswillslowthecodedownsouseonlyifneeded.

AnotherapplicationforthepurgeswitchariseswhenusingUnixsymboliclinksto makeadatasetappearasifitisinmorethanonesessiondirectoryatoncewithout copyingthebrickleForexamplesupposeonecreatesusingdmergeanaveraged

anatomicaldatasetGRPtlrcHEADandGRPtlrcBRIKfromsessionsfredethel, andlucyThiscouldbedonefromthedirectoryabovethesessionsbythecommands

dmergeprefixGRPgmeananattlrcHEAD

lnsGRPtlrcHEADfredGRPtlrcHEAD

lnsGRPtlrcBRIKfredGRPtlrcBRIK

lnsGRPtlrcHEADethelGRPtlrcHEAD

lnsGRPtlrcBRIKethelGRPtlrcBRIK

lnsGRPtlrcHEADlucyGRPtlrcHEAD

lnsGRPtlrcBRIKlucyGRPtlrcBRIK

ThelnscommandsputlinkstotheGRPanatomydatasetintoeachofthesession directoriesInthiswayiftheuserrunsAFNIwiththecommand

afnifredethellucy

theneachofthesessionswillhaveaccesstotheGRPdatasetbuttherewillonlybeone physicalcopyofitondisk.

AproblemariseswiththisschemebecauseofthemannerinwhichAFNIaccesseslarge bricklesTheprogramwillnotrecognizethatthelinkspointtothesameactualle, anditwillattempttommaptheGRPtlrcBRIKlemorethanonceThiswilllikely failandtheprogramwillcrashwhenthesecondaccessisattemptedwhentheuser switchestothesecondsession.

UsingthepurgeswitchwillavoidthisproblemBeforeanewdatasetisaccessed whenswitchingsessionsanatomiesorfunctionsexistingdatasetbrickswillbebe munmapedThiswillpreventtheattempttommapthesamebrickletwiceatthesame instant.

AnotherwaytoapproachthisproblemwouldbethroughtheuseoftheddupprogramtocreatewarpondemandcopiesoftheGRPtlrcdatasetineachofthesession directories.

R RecursivelysearcheseachsessiondirectoryformoresessionsubdirectoriesThis willdescendtheentirelesystemhierarchyfromeachsessiondirectorygivenonthe commandlineOnalargediskthismaytakealongtimeTolimittherecursionto5 levelsforexampleuseR.

ignoreN TellstheprogramtoignoretherstNpointsintimeseriesforgraphsandFIMcalculations.

unique

TellstheprogramtocreateauniquesetofcolorsforeachAFNIcontrollerwindowThis allowsdierentdatasetstobeviewedwithdierentgrayscalesorcolorscalesunique willonlyworkonbitPseudoColordisplaysforexampleSGIworkstations.

ncolorsnn TellsAFNItousenngraylevelsfortheimagedisplaysdefaultisSinceAFNI alwaysusesthedefaultcolormaponabitgraphicssystemyoumayrunoutofcolors ifyourunseveralgraphicsprogramsatonceWWWbrowsersarenotoriousforcausing thisproblemsincetheyusuallyallocatemanycolormapentriesandholdontothem justlikeAFNIdoes.

T ec hnicalNotes

TheMCWAFNIpackageisdistributedasacompressedUnixtarleafnitgzItis unpackedwiththecommand

gzipdcafnitgztarxf

TheleswillgointoadirectorynamedAFNI. AFNIrequiresanANSICcompilerXRandMotifItalsorequiresthatthe defaultXVisualbeanorbitPseudoColorvisualtheprogramwillnotworkwith anythingelseThisisordinarilynotaproblemexceptonverylowendandveryhighend workstationsandorXterminals. SeveralMakefilesareincludedinthedistributionThemachinestheyareintendedfor areindicatedbytheirlenamesuxIngeneralyouwillhavetomodifyoneofthese totyourneedsYoumayalsoneedtoeditthelemachdephtosetuptheagsfor themmaproutineappropriately. CopytheappropriateletobeMakefileExamineittomakesurethatitmakessense onyoursystemTobuildtheexecutablesusethecommandmakeallIfyousetthe INSTALLDIRmacrocorrectlyintheMakefilethenmakeinstallwillmvtheexecutable imagestotheirnalrestingspotAfterthatamakecleanisappropriate. TomakeandinstallthepluginssuppliedwithAFNIthecommandsmakepluginsand makeinstallpluginswillworkNotallsystemspecicMakefileshavethecommands neededtocompilepluginsThisisbecauseIdonothaveaccesstosuchcomputersystems. ThereareundoubtedlystillbugsinthissoftwareSuggestionsforfurtherimprovements willbegladlyreceivedbutnoactiononsuchsuggestionscanbeguaranteedTheemail addressforAFNIcommentsisrwcoxmcwedu.

mmaping

AFNIusestheUnixfunctionmmaptoaccesstheBRIKlesThisiswhatmakesitpossible toreadinmanylargedatasetsandnotchokethememoryorswapspaceofthecomputer. Dataisonlyreadfromdiskusingmmapallwritesaredoneusingfwrite.

IfyouneedtodisabletheuseofmmapedittheleddatahanddefineMMAPTHRESHOLD tobeThiswillmakeAFNIusemallocandfreadtoaccesstheBRIKdataThiswill alsostronglylimitthenumberofdatasetsthatcanbeused.

IfyoureceiveamessagethatAFNIcannotloadadatasetintomemoryormmapit, thenyoushouldrestarttheprogramwiththepurgeoptionThiswillforcedatasetsnot

inimmediateusetobepurgedfrommemoryandtobemunmapedwhichmightsolveyour problemThiswillalsomaketheprogramrunslowerwhenyouswitchbetweendatasets.

machdeph

ThisCheaderlecontainsmachinespecicsettingsIfyouareportingAFNItoasystem notavailableatMCWyouwillhavetocreateaMakefileappropriateforyourcomputer, andwillhavetoeditmachdephtosetvariousagscorrectlyInparticularagsformmap anddynamicloadingofpluginsmustbesetcorrectlyCommentsinthisledescribethe optionsthatareavailable.

XResourcesforAFNI

IncludedintheMCWAFNIdistributionisalecalledAFNIXdefaultsThiscontains examplesofhowvariousfeaturesofAFNIcanbecontrolledusingXresources.

FormulaforBkResampling

Denethecardinalbasisfunction

8 �

x4 jxj1

2 1

xjxjjxj1

jxj

ThenblockyinterpolationinDofafunctiondenedonagridwithspacingsxyz) toanarbitrarypointinspaceis

!

XXXxixyjyzkz

fxyzfixjykz:

xyz

ijk

Theactualimplementationofinterpolationisdoneinasomewhatdierentfashionforthe sakeofeciencySeethesourcecodeinafnislicec.

Ac kno wledgemen ts

ManythankstoJimHydeformuchsupportandmanydiscussionsonthedirectionof FMRIanalysesThanksalsoareduetoAndrzejJesmanowiczforforgingthewaywith AFNIsgrandfatherFDDougWardhascontributedalotwiththedmanddANOVA programsnewfeaturesindmergeplusthecreationoftheauxiliaryprogramsmanualMike Beauchamphasaidedimmeasurablybytestingearlierversionsofthissoftwareandbycoming upwithmanyusefulideasJayKummercontributedtheinitialideaforpluginsManyother peopleatMCWhavealsohelpedparticularlywithquickquestionsyouknowwhoyou areandtheoccasionalwarmpumpernickelbagelThisworkwaspartlysupportedbythe UnitedStatesNIHthroughgrantsMHandNSforwhichIamalsograteful.

MCWAFNI2.00 { Dec6

References

JeanTalairachandPierreTournouxCoPlanarStereotaxicAtlasoftheHumanBrain, ThiemeMedicalPublishersNewYork.

PeterABandettiniAndrzejJesmanowiczEricCWongandJamesSHydeProcessingstrategiesfortimecoursedatasetsinfunctionalMRIofthehumanbrainMagn. ResonMed.

RobertWCoxAFNISoftwareforanalysisandvisualizationoffunctionalmagnetic resonanceneuroimagesComputersandBiomedicalResearch.

RobertWCoxAndrzejJesmanowiczandJamesSHydeRealtimefunctionalmagneticresonanceimagingMagnResonMed.

Disclaimer:

MCWAFNIitsassociatedprogramsanditsdocumentationareprovidedasisandnowarranty fortheircorrectnessorusefulnessforanypurposeismadeorimpliedbytheMedicalCollegeofWisconsinMCWorbytheauthorofthesoftwareNeitherMCWnortheauthoracceptsanyliability foranydefectsinthissoftwareoritsmanualsorforanydamagescausedbyuseofthissoftware.

OwnershipConditionsofUseandRestrictions:

PermissionisgrantedtomakeuseofandtomakecopiesoftheMCWAFNIsoftwareand documentationfornoncommercialresearchpurposesonlyOwnershipofMCWAFNIand allcopiesisretainedbytheMedicalCollegeofWisconsin.

PatientcareapplicationsarenotrecommendedMCWAFNIhasnotbeenevaluatedbyor approvedbytheUnitedStatesFoodandDrugAdministration.

Useforanypurposebyforprotorganizationsisprohibitedwithoutpriorarrangementand writtenpermission.

RedistributionofMCWAFNIoranyderivedworkoutsidethereceivinginstitutionis prohibitedwithoutpriorpermission.

Copiesmaybemadewithinthereceivinginstitutionwithoutseparatepermissionfromthe MedicalCollegeofWisconsin.

TechnicalsupportegthexingofbugsforMCWAFNIisnotguaranteed.

Iagreetoabidebythetermsandrestrictionsabove.

SIGNATURE:

NAME: printclearlyortype)

DATE:

EMAILADDRESS: printclearlyortype)

ToRegister

Copythispageontoyourdepartmentalorinstitutionalletterheadsignanddateincludeyour

emailaddressandreturnviamailorFAXto RobertWCoxPhD BiophysicsResearchInstitute MedicalCollegeofWisconsin WatertownPlankRoad MilwaukeeWIUSA

FAX2 InstructionsonhowtoobtainAFNIbyanonymousftpwillbesentbyemail.