introduction 3 display 5 - research imaging...

32
USING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction ........................................................................................................................................... 3 Image Basics ..................................................................................................................................................... 3 Image Data ........................................................................................................................................................ 4 Display...................................................................................................................................................... 5 Layouts ............................................................................................................................................................... 6 Options ............................................................................................................................................................... 7 Zooming............................................................................................................................................................................... 7 Ruler/Angle Tools........................................................................................................................................................... 7 Crosshair Settings ........................................................................................................................................................... 8 Color Tables ...................................................................................................................................................... 8 Overlays ............................................................................................................................................................. 9 Regions of Interest ............................................................................................................................ 10 ROI - Multi-slice ............................................................................................................................................. 11 ROI – Controls................................................................................................................................................. 12 Mouse Actions ............................................................................................................................................... 12 Crosshair ………………………………………………………………………………………………………………………… 12 Paint/Edit ........................................................................................................................................................................ 13 Draw .................................................................................................................................................................................. 13 ROI – Special Tools ....................................................................................................................................... 13 Seed Growing ................................................................................................................................................................. 14 Isolate Component ....................................................................................................................................................... 14 Delete Component ....................................................................................................................................................... 14 Dilate/Erode Component ......................................................................................................................................... 14 Copy Component .......................................................................................................................................................... 14 ROI – Entering/Editing/Synthesizing (3-D) ......................................................................................... 15 ROI Logic Calculator .................................................................................................................................................. 15 Add ROI............................................................................................................................................................................. 15 Threshold to ROI .......................................................................................................................................................... 15 Range ............................................................................................................................................................................................... 15 Shrink Wrap.................................................................................................................................................................................. 16 Convex Hull ................................................................................................................................................................................... 16 ROI Inspector ................................................................................................................................................................. 17 ROI Morphological Operations ................................................................................................................................................... 17 Erode ......................................................................................................................................................................................... 17 Dilate .......................................................................................................................................................................................... 17 Open/Close.............................................................................................................................................................................. 17 Shrinkwrap........................................................................................................................................................................................ 17 Convex Hull…………………………………………………………………………………………………………………………………… 18 Propagate ........................................................................................................................................................................................... 18 Reflect .................................................................................................................................................................................................. 18 Single/All Slices Actions ..................................................................................................................................................................... 18 Statistics................................................................................................................................................ 19 Graphs ................................................................................................................................................... 19 Histogram ........................................................................................................................................................ 20 Cross-section .................................................................................................................................................. 21

Upload: vuongkien

Post on 08-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 1

TABLEOFCONTENTSIntroduction...........................................................................................................................................3ImageBasics.....................................................................................................................................................3ImageData........................................................................................................................................................4

Display......................................................................................................................................................5Layouts...............................................................................................................................................................6Options...............................................................................................................................................................7Zooming...............................................................................................................................................................................7Ruler/AngleTools...........................................................................................................................................................7CrosshairSettings...........................................................................................................................................................8

ColorTables......................................................................................................................................................8Overlays.............................................................................................................................................................9

RegionsofInterest............................................................................................................................10ROI-Multi-slice.............................................................................................................................................11ROI–Controls.................................................................................................................................................12MouseActions...............................................................................................................................................12Crosshair…………………………………………………………………………………………………………………………12Paint/Edit........................................................................................................................................................................13Draw..................................................................................................................................................................................13

ROI–SpecialTools.......................................................................................................................................13SeedGrowing.................................................................................................................................................................14IsolateComponent.......................................................................................................................................................14DeleteComponent.......................................................................................................................................................14Dilate/ErodeComponent.........................................................................................................................................14CopyComponent..........................................................................................................................................................14

ROI–Entering/Editing/Synthesizing(3-D).........................................................................................15ROILogicCalculator..................................................................................................................................................15AddROI.............................................................................................................................................................................15ThresholdtoROI..........................................................................................................................................................15Range...............................................................................................................................................................................................15ShrinkWrap..................................................................................................................................................................................16ConvexHull...................................................................................................................................................................................16

ROIInspector.................................................................................................................................................................17ROIMorphologicalOperations...................................................................................................................................................17

Erode.........................................................................................................................................................................................17Dilate..........................................................................................................................................................................................17Open/Close..............................................................................................................................................................................17

Shrinkwrap........................................................................................................................................................................................17ConvexHull……………………………………………………………………………………………………………………………………18Propagate...........................................................................................................................................................................................18Reflect..................................................................................................................................................................................................18

Single/AllSlicesActions.....................................................................................................................................................................18Statistics................................................................................................................................................19Graphs...................................................................................................................................................19Histogram........................................................................................................................................................20Cross-section..................................................................................................................................................21

Page 2: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 2

4-DSeries........................................................................................................................................................23ImageCalculator................................................................................................................................23ProcessingRange..........................................................................................................................................23MakeStatisticalImagefromTime-Series.............................................................................................23UsingMixedImagesArraySizes..............................................................................................................24MathematicalOperations...........................................................................................................................24Mathematical.................................................................................................................................................................24Statistical.........................................................................................................................................................................24Boolean............................................................................................................................................................................25Miscellanaeous..............................................................................................................................................................25

ImageTransforms.............................................................................................................................26Load…/Save…………………………………………………………………………………………………………………….26Options.............................................................................................................................................................26PredefinedTransforms..............................................................................................................................................26CenterofRotation........................................................................................................................................................26

Forward/Inverse...........................................................................................................................................27Concatenate....................................................................................................................................................27Undo..................................................................................................................................................................27

ImageFilters.......................................................................................................................................27SurfaceRenderedImages...............................................................................................................27Synthesis..........................................................................................................................................................28Viewing.............................................................................................................................................................28SurfaceAnalysis............................................................................................................................................29Shapes...............................................................................................................................................................29

VolumeRenderedImages...............................................................................................................30AdditionalInformation....................................................................................................................30SpecialFeatures............................................................................................................................................30FindOverlayClusters……………………………………………………………………………………………………….30CreateLogicalOverlays.............................................................................................................................................30AddParametricOverlay…........................................................................................................................................31LoadOnlineOverlay…................................................................................................................................................31LoadOnlineROI…........................................................................................................................................................31

SimpleHowTo…............................................................................................................................................31EditOrigin......................................................................................................................................................................31EditVoxelValue............................................................................................................................................................31EnterNotes.....................................................................................................................................................................31UpdateDisplaytoFullRange..................................................................................................................................32ReviewImageHeaderInformation......................................................................................................................32Summary........................................................................................................................................................................................32Header.............................................................................................................................................................................................32

Page 3: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 3

IntroductionAgreatdealofinformationisneededtoeffectivelyanalyzetomographicbiomedicalimagesacquired using magnetic resonance imaging (MRI), x-ray computed tomography (CT),positronemission tomography (PET), andsinglephotonemissioncomputed tomography(SPECT). Knowledge of anatomy, physiology, of subject(s) health, and imagingmodality(MRI, CT, PET, SPECT, etc.) are clearly important, as these are needed to define studyobjectives and guide analyses. However, an understanding of how medical images arestored,displayed,andanalyzedcanextend therangeof informationonecanobtain frombiomedicalimages.Manyimageanalysistoolsareavailable,soitisthetaskoftheanalystto select those that best address their needs. As such the user should be aware of thepurpose,capabilitiesandlimitationsoftheirimageanalysistools.Animageanalystshouldhave a clear understanding of their display andanalysis methods. In Mango, the focus is onvisualization and analysis of tomographic images, sothese are used as examples of its display capabilitiesandanalysisprocedures.ItwouldbehelpfultofollowalongusingMangowiththeseexampleswhilereading.When Mango is started a Toolbox is displayed withbasic menus for opening images, setting options,getting help, selecting windows as well as severalspecialcontrolicons.ImageBasicsAtomographicbiomedical imagecanbethoughtofasascalemodelofabiologicalobjectthathasalimitedfieldofviewspanningasubsetoftheobject(i.e.head,abdomen,knee).These digital 3-D images (also called volumetricimages)aredividedintosmallvolumeelementscalledvoxels(Figure1). Avoxel’s location isdesignatedbyits column, row, and slice position. A voxel has twoother properties: volume and value. Its volume isequal to the product of its dimensions (mm3). Avoxel’svaluemaybeparametric (CTnumber,T1,T2,cerebral blood flow) or a relative value (MRI signalstrength, SPECT counts). Voxel values are stored inimagefilesandorganizedsuchthateachvaluecanberetrievedusingcolumn-row-sliceaddressing.It is important to distinguish slice thickness, asacquiredbyatomographicimagingsystem,fromslicespacing.Forexample,anMRimagemightbeacquiredusing1x1x5-mmvoxelsusingthickslices(orsections)with a1-mmgapbetween. In this case the acquiredvoxel volume is 1x1x5 mm3 but the dimensionsneeded for accurate voxel display and spatial

Figure1.10Xzoomtoillustratevoxelsinanaxialsectionimageofthebrain.Voxelatintersectionatbluecrosshairhasimagecoordinate(95,93,75)andworldcoordinate(-33,15,10).Voxelvalueis1700(unitlessforthis1-mmisotropicspacing3-DMRimage).

MangoToolbox.

Page 4: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 4

measurementsare1x1x6mm3.Forthisexamplesignalsfromtissueswithinthe1-mmgaparemissing,which canbeproblematic for studieswhen subject scansmustbe repeated,since the gap will not likely be positioned identically at each imaging session. Fortomographic studies with large between-slice spacing compared to within-slice spacing,theprecision inspatialmeasurement ismuchpoorer in theslicedirection. Whenspatialmeasurementsarethegoal(volumes,areas,distances,etc.)imagesshouldbeacquiredusingasmall isotropic spacing, preferably 1-mm or less, such that accuracy does not depend onorientation.An image’s column, row, slice spacing andextent canbemodifiedusing aprocess called‘reslicing’(File/SaveAs…,/Reslice).Voxelspacinginareslicedimageisunderthecontrolofthe user. Voxel values for locations between the original locations are calculated usinginterpolation.Threeinterpolationoptionsareprovided:1)NearestNeighbor,2)Trilinear,and3) Sinc. These options are at theReslice/Transform tabwhen saving an image.Wesuggestusingnearestneighborinterpolationforstudieswherethevoxelvaluesneedtobepreserved (i.e. histograms before and after reslicing). Trilinear interpolationworkswellwithmanyimagesandisgenerallyagoodoptionwhenacquiredvoxeldimensionsaresmallcompared to the imaging system’s spatial resolution (FWHM), such as for fMRI, PET andSPECT. Sinc interpolation is recommended forusewithhigher resolution images suchasanatomical MRI where the voxel dimensions are approximately equal to the spatialresolution(1-mmorless).Forstudieswherethesummedimagevaluemustbepreserved(i.e.PETorSPECTtopreservetotalradioactivity) thesummayneedtobeadjustedafterreslicing.ThiscanbedoneusingMango’sImageCalculator(below).

ImageDataAdditional data (metadata)about the image are needed to ensure that voxel positions,dimensions, and values accurately represent the object. For example, the associationbetween image directions (col-row-slice) and body directions (x-y-z) and sensemust beknown.Thestandardforthehumanbodyisthatthe+xdirectionisbodyright,+ydirectionbody anterior, and +z direction body superior; and these are the standards usedwithinMango. Fornearlysymmetricobjects,suchasleftandrightbrainhemispheres, it iscriticalthatL-Rorientationbemaintainedthroughoutallstepsinimageprocessing.Thisorientationis automatically managed within Mango. Additionally, the physical spacing betweencolumns,rows,andslices,andtheunitofmeasure(mm)foreachmustbeknown.Withoutsuchinformation,thedisplayedimageshapemaybewrongandmeasurementof‘physical’distances,areas,andvolumesmaynotbeaccurate.Finally,todetermineavoxelvalueweneed to know the data type (number of bits 8, 16, 32, 64; integer or float; signed orunsignedandbyteorder)andtheunitofmeasure.Thesecriticalmetadataaredocumentedandrecordedatthetimetheimageisacquiredonabiomedical imagingsystemandstored inaportionof the image filecalledthe ‘header’.Mostbiomedical imagingsystemsstoreimagesusingaDICOMfileformat. OtherpopularformatsincludetheNIHrecommendedNIfTIandNIfTI2andanolderformatcalledAnalyze.

Page 5: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 5

Datainimagefilescanbeorganizedindifferentways,asprescribedintheimageheaders.ToaccommodatethisMangosupportsnumerousimagefileformats,includingDICOMfilesproducedbymedicalimagers.When an image file is opened, keyinformation from the header is used forprocessing and display.Mango representsdatainternallyusinga32-bitfloating-pointformat regardlessofthedataformatintheimage file. Voxels are indexed using col-row-slice addressing within this floating-pointarray.TheimageheadersummaryinFigure 2 shows that the image datawerestored in (X, Y, Z) body order wherecolumns(1stdimension)arealongX,rows(2nd dimension) along Y, and slices (3rddimension) along Z. There are 161columns, 191 rows, and 151 slices. The‘Data Orientation’ tag gives the sense ofimage-to-worldmapping. In thisexampleincreasing the column number is fromrighttoleft(toward‘-x’).Similarly,increasingrownumberisanteriortoposterior(toward‘-y‘)and increasingslicenumber is superior to inferior (toward ‘-z’). InMangoallimagesarerepresentedinternallyusinga‘standard’orientation. Thissimplifies imagedisplayandprocessingsinceinternallyallimageshaveidenticalcol,row,andsliceorder.Thereareseveraloptionsintheimageviewer’sEditmenuthatmaybehelpfulwhenanewimage isopened. TheFlipOrientation…optioncanbeusedtocorrect theorientation if itwasincorrectlyspecifiedornotintheimageheader.TheOrigin…optioncanbeusedtosetaworldspaceoriginiftheoriginisincorrectormissing.TheVoxel…optioncanbeusedtoassignavoxelvalueatthecrosshair’svoxellocation.Thisishelpfulforimbeddinglandmarksthattrackwiththeimagewhenacoordinatetransformisapplied. TheNotes…optioncanbeused to include a text note. Saving the image updates this information in the image fileheader.WhenMangoopensatomographicimage,itdisplaystheimagewithbodyrightontherightside of the image (Figure 3), a Neurological style display. This can be changed to aRadiological stylewith body right on the left in theToolboxOptions-Preferences…menu.Note:menuoptionsendingwith‘…’opensubmenus.

Display

Figure2.Summaryofimagefileheaderinformation.

Page 6: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 6

Whenanimagefileisopenedaviewerwindowautomatically displays the image along withmenus at the top (Figures 3 & 4). Multipleimagefilescanbeopened,eachwithadedicatedviewer. By default, Mango displays imagesusinga lineargrey scale.Keyboardoptionsareprovided to adjust brightness (cmd>mouseup/down) and contrast (cmd>mouse left/right).A shortcut is to use right mouse up/down(brightness) and left/right (contrast). Othercolortablescanbeselected(Greyscaleinverted,Spectrum, etc.) using the color table menubutton (leftmost on the toolbox). This menubutton mimics the current color table. Colortables such as the ‘red-to-yellow’ that rangebetween two colors are useful to displayoverlaysplacedonagreyscaleimage.

ViewerLayoutsMangosupportsseveral image layoutswithinaviewer. The default layout for tomographicimageshasthreeorthogonal2-Dsectionimages,one a large view and the other two as smallviews (Figure 3). By default, the large viewdisplaysanaxialsection(x-y)andthetwosmallviews display coronal (x-z) and sagittal (y-z)

views.Thebluecrosshairineachviewindicatestheintersectionpointofthethreesectionimages. The crosshair position is changed by pointing and clicking the mouse or bydragging the mouse. The mouse pointer within the images is a small red open-centercrosshair. Thecentralportionofthispointerisopensothat users can better see the image where it ispositioned.Thepointer’svoxellocationisdisplayedinthe Toolbox window as (col, row, slice) or (x,y,zlocation in mm) depending on the coordinate mode(imageorworld)alongwiththevoxelvalue.

The larger sectionview is formostuser interactions,forexampletoaddregionsofinterest(ROIs)aspoints,lines, or 2-D ROIs. Pressing the space bar swaps adifferent section into the large view, so the user canchoose the most appropriate section to work with.Anatomicaldirectionsare indicated in the largeview(OrientationOptioninViewMenucanturntheseoff).Two orthogonal viewer formats are available: ‘wide’withsmallerviewstotherightofthelargerviewand

Figure4.Viewerlayoutforsinglesectionimageview.

Figure3.Viewerlayoutfororthogonalviewing(Tallformat).

Page 7: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 7

‘tall’asinFigure3.Theseformatsareprovidedtohelptheuserselectedthebestmatchforspaceavailableontheirmonitor.Thissettingcanbewideforoneviewerwindowandtallforanother,i.e.itisviewerspecific.A third viewer layout option is for a single slice (section image) in one view (Figure 4).This isthedefault layoutfora2-Dimage,suchasanoptical imageordigitalx-ray.Whenthesliceviewer isusedwithtomographic images, thespacebarwill toggleviewingaxial,coronalorsagittalsections.Sincethereisonlyoneviewitcanbemadelargetoaidintaskssuchasmanuallytracingaregionofinterest.Slice,tall,andwideviewsettingsareineachviewer’s‘View’menu.

Options

ZoomingThe imageviewercanbeenlarged (cmd+/=) or reduced (cmd_/-) toprovideapreferredsize. There is also an option in the viewer’s ‘Window’ menu to increase size to themaximumsupportedbythemonitor.Mangoalsoprovideszoomcontrolwithintheviewswithout changing the viewer window size, zooming images in and out using

(alt_move_mouseup/down) andpanning using(shift_alt_dragmouse) [Figure 5].When enlargingand/or zoomingimages additionaldisplay pixelvalues areinterpolated. ThisInterpolation isonly for displaypurposes and doesnot affect image

data. Interpolation uses either bilinear interpolation or nearest neighbor interpolation,userselectablepreferencesinMango’sToolbox.Bilinearinterpolationisrecommendedforbetter display quality so that transitions between voxels appear smooth and thereforemore natural (Figure 5A). Nearest neighbor interpolation is provided for older slowercomputersorifsmoothingisnotdesired(Figure5B).

Ruler/AngleToolsRuler and Angle tools are available in a viewer’s ‘View’ menu to dynamically measuredistancesandangles.Thesetoolstoggleon(whenchecked)andaredisplayedinthelargeslice view. The tools are independentlymanaged in the three orthogonal section views.Therulertoolhassmallhandlesateachendthatcanbedraggedtodesiredlocations.The

Figure5A.Imagezoomed~3Xillustratingthe‘SmoothDisplay’optionwithbilinearinterpolationwherevoxeledgesappearsmooth.

Figure5B.Imagezoomed~3Xillustratingthe‘VoxelDisplay’optionwithnearestneighborinterpolationwherevoxeledgesappearjagged.

Page 8: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 8

ruler tool reports distances between its endpoints in units of mm with fractional mmprecision. Theangletool iscomposedoftwolineswithacommonvertex. Similartotheruler, theendpoints andvertexof theangled lineshavehandles that canbedynamicallymoved. The angle tool reports angles in degrees with fractional degree precision. Allmeasurementswiththesetoolsarebasedonthevoxelswherethetoolendsarepositioned.These tools can be used in combination with an image transform (Image Menu) to makemeasurementsonobliqueplanes.

CrosshairSettingsThe‘View’menualsohasoptionsforturningthemainand/orsmallerviewbluecrosshairsonandoff.Thecrosshairsarehelpfulduringanalysis,butsomeusersprefertorecordpictureswiththeseoff.The‘View’menualsoprovidesROIdisplayoptionsof‘Edgeonly’,‘Maskonly’,orboth. Whenbotharecheckedtheedgeisopaquebutthemask(insideoftheROI)ismade50%transparenttoshowtheimagebelow. The ‘View’menu has an option to displayROIstats for the current slice (when checked). This is helpful for reviewing slice-by-sliceROIstats. Slice stats include ROI area, mean value, standard deviation, center and centroid.Spatialunitsarevoxels(imagemode)ormm(worldmode).

ColorTablesColortablesdeterminehowimagevaluesaredisplayed.ColortableoptionsandassociatedcontrolsareatthecolormenubuttoninMango’sToolbox.

UnderstandingColorTables.Allcolor tableshavesettings forred,green,andbluerangingfromfulloff (0) to fullon(255), indexedwith256 levels. Imagevaluesaremapped intothis rangeof indices (Figure6). Imagevalues less thanorequal toDisplayMin areset toindex0andthosegreaterthanorequaltoDisplayMaxaresettoindex255. Inthistablevaluesbetweenthedisplayminandmaximagevaluesarelinearlymappedtoindicesfrom0-255.This256-indexrange isadequate forbiomedical imageswherethedynamicrange(signal max/signal noise) isoften less than 100, andsufficient to avoid grayscalecontouring in most biomedicalimages. The linear grayscaleRGBtablechangeslinearlyfromadisplaylevelof0atindex0toa display level of 255 at index255 (Figure 6). Image valuesassociatedwiththisfigurerangefrom a minimum of -175 to amaximumof4760,andtheuserset Display Min to 200 andDisplay Max to 3000. ImagevaluesbetweenDisplayMinandDisplayMaxfollowthegrayscale

Figure6.Anexampleofhow8-bitcolortablesareimplementedforalineargrayscaletable.

Page 9: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 9

table.ThoseaboveDisplayMaxaresettoindex255andthosebelowDisplayMinaresettoindex0.DifferentcolortableshavedifferentR-,G-,andB-valuesdependingonneeds.Whenimagesare displayed using non-grayscale color tables (i.e. spectrum color table) the resultingcolorsarecalledpseudo-colors. ColortablesprovidedwithMango includethosestartingwith a pure color and ending as white (red to white, etc.), changing from one color toanother (red to yellow, etc.), and combinations of colors (gold, spectrum). Special colortablesareusedforlogicaloperations,suchasoverlappingoftworegionsofinterestasROIA(AND)ROIB.Logicalcolortablesdonotvarybyindex,i.e.theyareasinglecolor.The recommended approach to create a new color table is to edit an existing table(Options/Color Table Manager…). As with many new tasks color table editing requirespractice,butspecialeditingtoolsareprovidedtosimplifythetask.

OverlaysOverlayingoneimage(source)ontoanotherimage(target)isrobustlysupportedinMango.Uptoeightsourceimagescanbeoverlaidontoasingletargetimage,andthesecanbefromdifferent imaging modalities. The source image is interpolated to match dimension andspacingof the target imagewhenoverlaying. Mango’s coordinate mode determines howsource and target images are registered for overlaying (Figure 7). When using ‘image’coordinatemode(3rdToolboxbuttonmenu)theoriginofthesourceimageispositionedtoalignwiththatofthetargetimage(col,row,slice=0,0,0)(Figure7,Left).Thisworkswelliftheobjectswithin these images areoriented the sameandpositioned the samedistancefromthisorigin,whichisoftennotdone,asisthecaseforFigure7,left.Whenoverlaying in ‘world’ coordinatemode (3rdToolboxbuttonmenu) theworld-spaceorigins (x,y,z=0,0,0) are aligned (Figure 7, Right). This approach is especially useful foroverlaying brain images where a standard origin has been adopted, for example theanterior commissure inthe mid-sagittal planeof the brain. However,any two objects can beoverlaid in worldcoordinate mode if theoriginineachissettoanidentical landmark.This assumes thatobjects to be overlaidare also oriented thesame.Whenmultipleoverlaysare used each is

Figure7.Overlayoftwosourcebrainimagesontotargetbrainimageusingimagecoordinatemode(Left)andworldcoordinatemode(Right).Overlay’stransparencyat50%.

Page 10: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 10

automatically assigned a different color. Color tables can be changed if needed. Colortables for overlays are different from that of the target (underlying) image. An overlayimage is not displayed belowDisplayMin, but is displayed according to the color tablebetween DisplayMin and DisplayMax. Within this range the overlay can obscure theunderlying target image, and to deal with this overlay transparency can be adjusted toshowbothsourceandtargetimages(Figure7).Importantly,overlayingcanbedoneinthe‘world’ coordinate mode even when image dimensions and voxel spacing are muchdifferent.Forexample,inFigure7,right:targetimagearrayis240x320x192at0.8x0.8x0.9mm spacing; red overlay 256x256x256 at 1-mm isotropic spacing; green overlay220x320x208at0.8mmisotropicspacing. Note: Thebrain images inFigure7werenotspatially normalized but did have the same general orientation and the same worldcoordinateorigin (anterior commissure).Overlays canbehiddenor removedusing theircolortablebutton.Hidingthemishelpfulwhen several overlays are present, andyouwanttoviewthemindividually.

RegionsofInterestMango supports point, line, single-slice(2-D) and multi-slice (3-D) ROIs. ApointROIisindicatedintheviewerasasmall colored circle (Fig 8, red). Whenselected for analysis a white ringappearsaroundthecircle. AlineROIisdefined as a single or multiple linesegments of the same color (Fig 8,green). When selected a white ringappears around its end points. A 2-DROI can be displayed as an outline(edge), filled (mask) or both (Fig 8,blue). When both options are selectedthemasktransparencydefaultsto50%.TheROIcolorisdeterminedbythecolorof the ROI button in Mango’s toolbox.Pressing the button brings up a list ofROI colors. Also, ROI labels can beenteredusingthisbutton.

ToobtainstatisticsforanROI,highlightit and select the viewer’s menu optionAnalysis/ROI Statistics. A shortcut forROI stats clicking the right mousebuttonwiththemousepointerovertheROI. Summary statistics are posted inthe ‘All Results’ window (Figure 8) for

Figure8.Slice,Point,lineandareaROIswithstatisticsdetailedinResultstables.

Page 11: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 11

selectedROIs.ROIStatscanbecalculatedforthecurrentslice,allslices,orovertheROIsentire volume (slice range). The All Results widow has two tabs, one for Global stats(overall) and the other for Point stats (key locations). Global stats provide mean, sum,standarddeviation,size(line[mm]&volume[mm3]),andcount(numberofvoxels). Iftheareaofa2-DROI isdesiredtheusercandividethereportedvolumebytheslicespacingorassessusingthevoxelcountandtheareaofthevoxelface.Pointstatsareprovidedforthemaximum,minimum,andcentroidlocationsofeachentryintheglobaltable.ThelargecrosshaircanbepositionedatthepointlocationintheimagebyselectingarowinthePointstable.InFigure8thebluecrosshairispositionedattheredROI for Point 2, and the Point-2 row in the Points Stats table is highlighted. An ROIscentroidmaynotfallwithintheROI,andinFigure8 it isoutsideboththegreenlineandblueROI.Figure8alsoincludesdataforwholeslicestats.NotethattheblueROIinFigure8was treated as a single ROI though it had two non-connected components, one in lefthemisphereandoneinright.

Multi-sliceROIAmulti-sliceROIofthesamecolor is a3-D ROI (also called a volume of interest or VOI).Figure 9 illustrates the multi-slice nature of Mango’s 3-D ROIs in the orthogonal sliceviewer.Thesurfaceviewer(Figure9,lowerright)revealsthe3-Dnatureofthesurfaceofthe lateral ventricle formed from itsROI. A 3-DROI neednot be connectedbetweenorwithinslices,soitcancontainmultiplenon-connectedcomponentsaslongastheyarethesamecolor.Inthesurfacedisplayof Figure 9 the 3-DROIwasconvertedtoasurfacemodelusingsmall polygons(triangles) spanningthesurfaceinamesh-like manner. Mangoprovides twostatistical measuresfor surface meshes,surface area andvolume.Surfaceareais calculated bysummingareasofthesmall triangles.Volume is calculatedusingamethodbasedon Gauss’sDivergence Theorem

Figure9.OrthogonalsectionviewofROIspanningtheLateralVentricleand3-Dsurfaceviewtoshowthe3-DnatureoftheROI.

Page 12: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 12

(Eberle et al., 1991,Lancaster et al., 1992). Volumes calculatedusing surfacemeshesorfrom imagevoxelsdifferbyonly1-2%, soeither canbeused. Surfaceareadependsonspatial resolutionand thenatureof the surface, soitisbestifallimagesusedinastudyofsurfaceareahave the samespatial resolution. Simple thresholding can lead to a surfaceother than thatdesired, alongwithunintendedvolumeandarea stats. For example, theexternalsurfaceofabrain isbest isolatedusing theROI/shrinkwrap thresholdingoption,whichavoidsinternalbrainsurfaces.WhenthresholdingisusedtodefineanROIboundaryitisimportanttofollowastandardprocedureandonethatcanbereadilyreproduced.

ROI–ControlsDelineatingaregioninanimageforanalysisisthemainpurposeofROIs.Mangoprovidesa wide range of ROI entering, editing, and analysis tools. ROI tool actions are for thecurrentROIcolorselectedusingthecoloriconintheToolbox.IfmultipleROIsarepresent,selectingadifferentcolorbringsthatROItothefront,andactionisdirectedtotheselectedROI color. ROI manipulation (move, resize, delete, statistics, etc.) requires that it beselected.ToselectasingleROIusingthemouseitmustbeinpointermode.PointingwithinanddoubleclickingselectstheROI.Also,inpointermodeshift-draggingwillopenadashedselection box that you can use to surround and select an ROI. Once selected the ROI isboundedbyacontrolboxthatcanbeusedforresizing(Figures8&9). Whenthemousepointer is positioned inside this box its icon changes to a small hand, and draggingwillmove the ROI. Double clicking outside a selected ROI deselects it. The ‘Select All’ and‘DeselectAll’optionsintheviewer’sEditmenucanbeusedtoselectordeselectallROIs.

MouseActionsTheicon-stylemouse-actionmenuintheToolboxhasseveralcategoriesforchanginghowthemouseisused(Figure10).MouseactionsareforthecurrentROIcolor.

CrosshairWhen selecting options themouse pointer is a standard smallup-left arrow (standard system pointer); however, the mousepointer changes to a small red open-center crosshair wheninsideaviewer(a targetingcrosshair). The locationandvoxelvalue(displayedinToolbox)changesasthecrosshairpointerismoved around using themouse. This pointer can be used tonavigatethroughtheimagesbyclickingand/ordragging.Whenothermouseactionsareselected,thepointerchangestoashape appropriate for the selected action (Figure 10). Theseactionsareonlyforuseinthelargerimageview.Tonavigatetoadifferentsliceinthelargeview click or drag the mouse pointer in one of the smaller views or use the keyboardnavigationkeys.

Figure10.Mouse-ActionMenu.

Page 13: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 13

A ‘Quick Toggle’ setting in Options/Preferences/Shortcuts provides a way to switchbetweentwomouseactionsbypressingthekeyboard ‘f’key. WerecommendsettingtheCrosshair pointer as one option (this is the default) to easily get back to the standardpointermodefromothermouseactionmodes.

Paint/EditIn thePaint/Editmouse actionmode themousebecomes a tool for creating and editingROIs. Thiscategoryhasasubmenuwheretheusercanselectanellipticalorrectangularshapedtoolwiththreeactions:painting,erasing,andediting.Draggingthemousepaintsorerases.PaintingaddsvoxelsunderthetooltotheROI,anderasingremovesvoxelsunderthetoolfromtheROI.TheeditingoptionwillpaintwhenthetoolisdraggedwithinanROI(used to push border outward) and erasewhen dragged outside the ROI (used to pushborderinward).Toolsizecanbeincreased(+)ordecreased(-)asneeded.Aspecificrangeofimagevaluesforpaintingcanbeset,helpfultoonlypaintvoxelswithinadesiredvaluerange.Thesetoolactionscanbeextendedfrom2-Dto3-Difnecessaryusingthe‘SetToolSize/SetToolSliceRange’option.Themouse-actioniconisautomaticallysettothatofthelasttoolselected.

DrawThe Draw action button provides a submenu with options for drawing rectangular andellipticalROIsorfortracinganROI.Standardrectangularandellipticalshapedobjectsaredrawnbyclickingtosetthestartingpositionanddraggingtosetsize. Tracing isusedtomanuallyoutlineanareaof interest. Clickingthemouseplacesapoint,andmovingthenclickingsetsanewpointandconnectstheprecedingpointtothecurrentpointwithaline.This iscontinueduntil theuserclicksnearthestartingpoint tocompletetheROI(closesthe outline). Tracing can be done by dragging the mouse, but dragging creates morecomplexoutlines(manypointstotrack);however, itcanhelpwheresmoothoutlinesareneeded. Small errors made when outlining an ROI can be corrected using edit mode.Tracingismostlyusedtomanuallyoutlineastructuretomakea2-DROI.TheDrawmodealsohasoptionsforpointandlineROIentry.Pointsareenteredforeachclickandlinesbyclickingtwoendpoints.Clickingmultiplepointsdrawsamulti-segmentedline,andpressingenterclosesthelineROI.In‘trace-line’mode,endpointsofthelinecanbemoved if needed. The line can bemoved around (up-down& left-right) in standardpointermodeifthelineisselected.Reminder:Themouseactionsofpainting,drawing,andeditingapplytothesectionimageinthelargeview,sotheyarespecifically2-DROIactions,buttheiractionscanbeextendedtonearby slicesusing the slice rangeoptionas indicatedunderPaint/Edit.Note:Whenasingle-sliceROIofthesamecolorisenteredonmultipleslicesitbecomesa3-DROI.

ROI–SpecialToolsTheSpecialmouseactionmenuhastoolsthatautomateentryandeditingofROIs.Theiconfortheseissimilartothe‘MagicWand’usedinPhotoshop,sowerefertotheseasMagic-

Page 14: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 14

Wandtools.These toolsare forediting2-Dor3-DROIs thatconsistofoneormorenon-connected components. Some tools are specifically designed for independent editing ofsuchcomponents.Theconceptofvoxelneighborsisimportantforprocessingcomponents.InMango,aneighboringvoxelisonethatsharesaface(adirectneighbor)andavoxelina3-Dimagecanonlyhavesixdirectneighbors. AllvoxelswithinthesamecomponentofanROIareneighbors,butnoneareneighborsofvoxelsinothercomponentsoftheROI.

SeedGrowingFor theAddRegioninValueRange option theuser clicks a location in the image to set astartingor ‘seed’voxel for theROI. Aneighborvoxelwillbeaddedto theseedROI if itsvalue fallswithin theuser-designatedvalue range. Thisprocess is repeatedand theROIenlarged until no new neighboring voxels are found within the designated range. Thisprocess is called seeded regiongrowing. The range can be a symmetric range (RelativeRange)oramin-maxrange(ExplicitRange)abouttheseedvoxel’svalue(lesssensitivetowhere the seed is selected). The processing is semi-automatic since the user selects theseed locationandsetsup thevaluerange. This tool isuseful formakinga3-DROI forasmall region of interest that is clearly distinguished from its surrounds but which hasvalues similar tomoredistant (non-connected) regions. OneuseofthisoptionistomakeROIsforindividualstructuressuchasthelateralventriclesinFigure9,orcaudate,putamen,orthalamusinhigh-resolutionMRimages.

IsolateComponentThePreserveRegionoptionisusedtoisolateasinglecomponentofmulti-componentROI.Automated ROI methods sometimes leave many small, undesired non-connectedcomponents. Thesecanbe removedbyclicking in thedesired component ‘preserving’ itandremovingallothers.

DeleteComponentAnalternativeisRemoveRegionthatdeletesacomponentofanROI.Clickingwithintheundesiredcomponentsremovesthem.This option is useful to remove a small number of undesiredcomponents.

Dilate/ErodeComponentThe Dilate/Erode Region option will dilate (click) or erode(shift-click)acomponentofanROIusinga3x3x3tool(SeeROIMorphological Operations below). These actions enlarge orshrink the component ROI. These actions are also menuselectablebyright-clickingovertheROI.

CopyComponentTheCopyRegionwillcopyaselectedcomponentofanROIthatcan be pasted using standard keyboard or editmenu options.To do this we recommend changing the ROI color before

Figure11.ViewerROIMenu.

Page 15: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 15

pastingtodesignateitasadifferentROI,oralternativelypastingtoadifferentimage.

3-DROIs–Entering/Editing/SynthesizingMultiple options are available in the viewer’sROIMenu that extendMango’s automatedentry,analysis,andeditingROIcapabilities(Figure11).Theseoptionsareprimarilyfor3-DROIs. Someactionssuchas ‘Dilate’aremeaningless forpointor lineROIs,andactionsthatarenotapplicableforaselectedROItypearegreyedout.

ROILogicCalculator…TheROIlogiccalculatorprovidesameanstomakenewROIsfromexistingonesusingthelogic operators “NOT, AND, XOR, and OR”. An example is provided in Figure 12whereoverlapping ROIs of the visual systemweremade using the “AND” operator. Users canselect the colors and assign names to each ROI. Other options include “union” and“intersection”.Parenthesesareprovidedtosupportmixedandcompoundoperations.

AddROI…AddROI provides options to insert a cubic orspherical 3-D ROI of selected size (mm)centeredatthebluecrosshair.Thisisusefultoplace an ROI at a brain x-y-z coordinate inworldcoordinatemode.Animpliedassumptionwhenusingworldcoordinatesforbrainsisthatthebrain imagehadbeenspatiallynormalizedtoeither theTalairachor theMNIbrain spaceandthattheoriginwasproperlydefined.CubicandsphericalROIscanbeusedtodynamicallyprobe and analyze different parts of an imagewhencombinedwithROIStats.

ThresholdtoROI…Threshold to ROI is an automated method todefine a 3-D ROI. There are multiplethresholdingoptions.Thedefaultusesasinglethreshold and all voxels with values greaterthan or equal to the threshold value areincludedwithintheROI.Thisoptionissuitablewhenthetissueofinteresthasthehighestrangeofvoxelvalues,suchasboneinx-rayCTimages.NOTE:Nomenuoptionisselectedforthisoperation.Range.Withthisthresholdingoptiontheusercanselectminimumandmaximumvaluesforthe ROI. Range defaults to the minimum and maximum display settings, but can bechanged as needed. This option is useful for images where ranges are necessary todelineatetissuetypessuchasx-rayCT(fat,softtissue,bone).Thisoptionisalsousefulto

Figure12.UsingtheROILogicCalculatortodeterminenewROIsfromoverlappingones.

Page 16: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 16

make an ROI for a range of negative values, for example a range of only z-scores in astatisticalparametricimage,withoutincludingpositiveones.ShrinkWrap.Thisthresholdingoptionformsaclosed3-DROI(noholes)aboutanobjectusingasinglethresholdvalue(minimumor%ofmax).ThisoptionisusedwhensimpleorrangethresholdingleadstoROIswithunwantedholes.ShrinkWrapisoftenusedtomakeawholebrainROIwithoutholescausedbyinternalregions,suchasventricles,whenusingsimplerthresholding.TheShrinkWrapoptionfirstfindsasingleclosedexternalROItheninvertsittoformanROIcontainingonlyobjectvoxels.The‘ShrinkWrap’procedureusestwo criteria when forming the ROI, a threshold and connectivity. For 2-D optionsconnectivity is enforced either 1)within axial sections, 2)within coronal sections, or 3)withinsagittalsections;ignoringdirectionsorthogonaltothesection.The3-Dconnectivityoption ensures within- and between-slice connectivity. The 2-D and 3-D options yieldslightly different ROIs, but the 3-D approach is recommended unless youwant to avoidconnectivity between sections. TheShrinkWrapROIprocedurecanbeused todefine theexteriorboundaryofanyobjectwhenasinglethresholdisappropriate.Convex Hull. This threshold ROI option forms the ROI as a convex hull using a singlethresholdvalue(minimumor%ofmax),avoidingconcavities.

ROIInspectorTheROIinspectoropensanewwindowthatletstheuserquicklymovethelargecrosshairtoaspecificROIbyclickingitscoloricon.ThisishelpfulwhenmanyROIsarepresentinanimageorthedesiredROIishardtolocate(perhapsapointROI).InVersion3.0ofMangotheNavigateROIsfeaturereplacedtheolderCountROIsfeature,andinMangoVersion4.0theROIInspector replacesNavigateROIs. ROIs are listed in groups as Points, Lines, andRegions(separatedvertically).Acolorbuttonalongwiththenumberofitemsisindicatedalongside point and line color icons.When a color icon is clicked the large crosshair ismoved to the indicatedROI. Forpointsand lineswithmultipleROIs, repeatedlyclickingtheiconcyclesthroughthem.The2-Dand3-DROIsarelistedin‘Regions’rowsbycolor.ThereareoptionstoselectanROIwhenmovingthecrosshairtoitandtodeselectothers.ROI labelscanbeenteredand/oredited inthe inspector’s text field.Note:ThenumberofROIswillexpandbyrowsofeightifnecessary.

ROIMorphologicalOperationsMorphologicaloperationsareprovidedtoassistinmodifying3-DROIs. Theseoperationsarebasedona3-Dstructureelement,withsizeuserselectable.Forsize=3thestructureelement isa3x3x3region. Thedefaultsizeof thestructureelement is3,but thiscanbechangedbeforeusingtheoperator.Ifanevennumberisentereditisadjusteduptoanoddnumber to ensure that the operation is symmetric about its center.Note:MorphologicaloperationsarenotprovidedforpointorlineROIs.Also,theseoperationscanberestrictedto2-Dbyselectingthesinglevs.multiplesliceoptioninMango’stoolbox.

Page 17: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 17

Erode…TheErodeoperationreducestheboundaryofanROI. To aid with the description of thisoperationwewill assume that voxel valueswithin theROI = 1 and outside theROI = 0.Duringtheerodeoperationthestructureelement ismovedthroughout the imagetestingfor boundary ROI voxels. When the structure element is centered over ROI(x,y,z) theerosionaction sets its value to theminimumvaluewithin the structure element’s range.Awayfromaboundarywherethestructureelementiseitherfullyoutside(all0’s)orinsidethe ROI (all 1’s) no action is taken. Near a boundary,where there are both 0’s and 1’swithinthestructureelement’srange,ROI(x,y,z) isset tozero,removingboundaryvoxels.ErodeROIwill removean isolatedcomponent foranROI that is smaller than the structureelement. Erodingaction isuseful toremovesmallcomponentsoutsidethemainROIthatwereinadvertentlyincludedwhentheROIwasmade,suchasthoseduetophasenoiseinMR images. The Preserve action in the Cursor Special menu can be used to removecomponentsthatweredisconnectedbyeroding,preservingonlythemaincomponent.

Dilate…TheDilate operation extends the boundary of an ROI. The dilate operation is similar to theerode operation except it sets the ROI value at the structure element’s position to themaximumvaluewithinthestructureelementsrange,i.e.thenumericvalueassignedtotheROI.ThisactionaddsvoxelstotheboundaryoftheROI.ROIdilationisusefultofillinholeswithinan ROI that are smaller than the structure element. It can also be used to bridge gaps andenlargethinconnectionsbetweendifferentpartsoftheROI.

OpenClose…Erosionanddilation canbeused inpairs since theycanundoeachother’soperation.AssuchtwootherROImorphologicaloperatorsareprovided:1)Closethatdilatesthenerodesand2)Open thaterodes thendilates. Theseoperationsaresuccessfulas longasdesiredsmallregionsarenoteliminated(erosion)oradesiredsmallholearenotfilledin(dilation)bythefirstoperation. AnalystshouldpracticeusingthesemorphologicaloperationstogainmoreexperienceanddetermineconditionswhentheywillbeusefulineditingROIs.

ShrinkWrap…TheShrinkWrap…menuoptionusesasingleROIasthestartingpointforshrinkwrappingtheregionof interest.ThestartingROIisusedtoestablishaworkingregionsurroundingthestructureofinterest,whileexcludingareasthatmightinadvertentlybeincludedbasedon the thresholdvalue. Forexample, it canbeused to forma2-DROIabout the corpuscallosum(CC)inthemid-sagittalslice. First,roughlytraceanoutlineROIabouttheCCinthemid-sagittalsectionimage.InspectthehistogramfromwithinthisROItodetermineathreshold value, then shrinkwrap theROI onto the CC (Figure 9).Thisoptionworkswithboth 2-D and 3-D ROIs. Additionally, it performs independent shrink wrapping for eachcomponentofmultiplecomponentROIs.

Page 18: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 18

ConvexHullAnotheroptionistoconvertanROItoaConvexHullROI. Aconvexhull isasurfacethathasnoconcaveregions,inthiscaseanROI’ssurface.Thereareanumberofalgorithmsforthisbutyoucanthinkofitasaddingvoxelstofillinconcavities.TheconvexhulloptioncanbeusedtomakeanROIinahigh-resolutionbrainimagethatisgeometricallysimilartoonefrom a low-resolution image (PET, SPECT, fMRI) both without sulcal regions. Someinvestigatorshaveusedtheconvexhullasameanstodeterminethe levelofgyrification,comparingaconvexhullbrainROIwithacorrespondingshrink-wrappedbrainROI.

Propagate…ThePropagate…operationextendsa2-DROI(suchasoneformedusingROIpainting)toadjacentslices,formingacontiguous3-DROI.Optionsareprovidedfortheusertosetthedesiredslicerangeorallslices.AcommonuseofthisoperationistoenteranROIenclosingthedataofinteresttoremoveexteriorimagedata,noiseorotherwise.Toachievethistheuser firstentersa rectangularROI thatextendsacrossa section image. ThisROI is thenpropagatedtoenclosetheslicerangeof interest. Finally, theImageCalculator(below)isusedtozeroallvoxelvaluesoutsideoftheROI.

Reflect…TheReflectaboutVerticalandHorizontaloptionmakesacopyofanROIreflectedaboutthevertical or horizontal position of the large crosshair. ThisisusefultocomparestatsofanROI formed in the one brain hemispherewith an identical ROI in the other hemisphere byreflectingitaboutthebrain’smidsagittalplane.

Single/AllSlicesActionsYoucantoggleROIactionsbetweensinglesliceandallslicesusingtheslicesbuttonintheToolbox. The icon for this button has three horizontal bars, representing slices. Thedefault setting is the ‘All Slices’modewhere all threebars arebold. In the ‘Single Slice’modeonlythemiddlebarisbold.Clickingthebuttontogglestheslicemodes.Thesemodesare also referred to asROI/VOI processingmodes. The single-slicemode can be used toapplydifferentROIthresholdsfordifferentslicesduringentry.Thesingle-sliceoptioncanalsobeusedtoerodeordilateasinglesliceofanexisting3-DROI.MostROIenteringandeditingisbestdoneinthedefault‘allslices’mode.Important: ManyROIactions in theviewer’sROImenucanbeundoneusing the ‘Undo’option in the viewer’s Edit Menu. A buffer stores the prior result providing this undocapability.Thereisalsoanoptionto‘Redo’thatwillreversetheactionofUndo.Onlyonelevelofundo/redoissupported,somakesureyouaredonebeforebeginningotherprocessing.

Page 19: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 19

StatisticsThemostbasicimageanalysisfeatureinMangoisastatisticalsummaryofanimageoritsROIs(mean,sum,standarddeviation,size,andvoxelcount). ImageandROIstatisticsareoptionsintheviewersAnalysismenu.Ashortcutforimageanalysisistorightclickwithintheviewer,whichpopsupasmallmenuwithanoptiontoAnalyzetheimage.Theresultsof the analysis pops up the ‘All Results’windowwhich tabulatesGlobal (full image) andPointstatistics (Figure13). When imagestatistics ishighlighted in theviewer’sAnalysismenumore options are available than provided by the quick popup analysis. Additionaloptions include calculating over the entire 3-D image, the current slice, or slice-by-slice.For4-Ddata,optionsareprovidedfor‘EntireSeries’or‘AllVolumes’.IfmultipleROIsarepresent, individualstatswillbecalculatedforallthatareselected.Tabulatedstatscanbe

highlightedandcopiedintoanotherdocument(word,excel,etc.)orexportedtoacomma-separated values (csv) file format for opening in excel. Note:The slice-by-sliceoption isuseful for comparing statsofa convexhull vs. shrinkwrappedROIof thebrain for coronalbrainslices.ThetwotabsatthetopoftheAllResultswindowtogglebetweenglobalorpointstatistics.Global Size is inunitsofmm3 for imagesandglobalCount is thenumberof voxels. Thepointstablelistsvaluesandx-y-zlocationforthemaximum,minimum,andcentroidoftheimage.Ifanatlasisactiveitsfourlabelswillbelistedforeachpoint.

GraphsMangoprovidesx-ystylegraphsforthreedifferentdatatypes:1)afrequencydistributionof image values (histogram), 2) data along a line (cross-section), and3) data along a 4thdimension(time-series).Allgraphwindowsareresizable.

Figure13.AllResultswindowwithGlobal(top)andPoint(bottom)imagestatistics.

Page 20: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 20

HistogramAhistogramisagraphofthenumberof voxels within small value binsplottedoverarangeofimagevalues(Figure 14). When the histogramoption is selected it opens a newwindowwithahistogramgraphandoptions for inspection andrecalculating.Histogram values are displayed inthe graph area using the mousedown action to move a red lineacross therange(Figure14). In thisfigure, the graph’s value range is0-3000 (x-axis) and thehistogram isplottedusing188bins of size~ 16. The highlighted bin range is from1739.44 to 1755.40, and there are65,957voxelswithvalueswithinthatbin.Thegraph’sy-axismax isautomaticallyset to themaxvalue in thehistogram.Thex-axisMin & Max values default to those of the image display settings when the histogramwindowisfirstopened.ThesecanbechangedbyenteringnewvaluesintheMinandMaxtextboxes.Theplottedhistogramcanbecustomizedbyaltering:1)Min&Max(here0&3000) and 2) the number of bins (here 188 and determined automatically). ClickingCalculate updates the histogram. There are two other settings: 1) ExcludeZero (defaultsetting)–donetokeepmanyzerosoftenfoundoutsidetheobjectfromsettingthemaxy-axis display toohigh and2)AutoBinning that uses an empirical algorithm to estimate agoodbinsizeforthegraph.Thesecanbeturnedoffifdesired.WesuggestsettingMin>0ifExcludeZeroisnotselected.Clicking or dragging themouse selects and highlights a single bin in the histogram. Thehighlightedbinrangecanbeexpandedusingthesmallarrows.Thehighlightedrangecanbe dragged across the graph to inspect different regions of the histogram. In Figure 14there are three brain tissue ranges with distinct peaks, the rightmost peak is for whitematter(~2300),themiddlepeakforgreymatter(~1750),andthethirdpeakforcerebralspinalfluid(~800).Voxelswithinahighlightedhistogramrangearealsohighlightedinthemainimageviewerusingthesamecolor.HistogramhighlightcolorscanbechangedusingthecoloriconbuttoninMango’sToolbox.Highlightingintheimageisdynamicallyupdatedasthehighlightedrangeinthehistogramisadjusted(widthorposition).Thisishelpfulfordeterminingathresholdtousetodefineedgesforregionsofinterest.Infact,iftherangeisacceptable, clicking the Generate ROI option will make an ROI using the highlightedhistogramrange.ROIediting tools canbeused toedit theROI ifneeded.Histogramdatacanbeexportedasa‘csv’fileforfurtheranalysis. Thisisdonebyclickingonthesmalliconadjacenttothecameraiconinthehistogramdialogwindow.

Figure14.Histogramfrom3-DT1-weightedMRimageofthebrain.

Page 21: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 21

AswithmanyofMango’sanalysis features thehistogramcanbecalculated for theentireimageorforaROI.TheROIcoloriconinMango’sToolboxdetermineswhichROItouseforhistogram analysis. Clicking the ROI checkbox in the histogram window switches fromwhole image histogram to ROI histogram mode. This is especially useful in refining aroughly formed ROI, such as one traced outside the corpus callosum (CC). The roughlyformedROI excludesmost of the brain but contain all of the CC (like in Figure 9). ThehistogramcalculatedusingthisroughlyformedROIcanbeusedtodeterminearangeforrefiningtheCC’sROI.Finally, the histogram’s graph can be toggled between Data (the default), Rate, andCumulativemodes.DataandCumulativemodesarethemostcommon.They-maxvalueofthe cumulative mode is the number of voxels within the histogram’s range settings(excluding zeros if thatwas selected). Themedianvoxelvaluecanbeestimatedfromthecumulativedistributionasthex-valueonthegraphwherey=½y-max(where½ofthevoxelsarebelowtheindicatedx-value).

Cross-sectionA cross-section is a graph of image valuesspanned by a line ROI. The graph can beplotted as data (voxel values), rate, orcumulative similar to the histogram graph.Thepositionalongthelinecanbedisplayedin image (voxels) or physical (mm) units(Figure15).Theaveragevalueofthecross-section’sdataisindicatedadjacenttothey-axis. Thisgraphisusefulforinspectingleftvs. right sideprofilesusing a line spanningfrom the left to the right side of the body(especiallyinthebrain).LineROIsaredrawnatdisplayedresolutionandare redrawn toaccurately trackas thevieworviewerarezoomed.Themm-spacingalongalinedefaultstothesmallestunitintheimage,butcanbemadesmallerorlarger(inmm-mode) by typing the desired value in themm text area. Values are interpolated tosupportthatuse.Movingthemousewithinthegraphdisplayspositionsandvalues(Figure15)anddraggingadditionallydisplaysapointmarkeronthelineROIintheimageviewer.Doubleclicking in the leftmarginof theverticalaxisbringsupasmalldialogwindowtochangetheverticalmin-maxrange. Aswiththehistogramgraphthecross-sectiongraphcanbeexportedasa ‘csv’ file for furtheranalysis.Note:Thecross-sectiondataisexportedusingthelinespacingselectedforthegraph.Multiple line cross-sections are supported in either the same or different colors. ThecurrentROIcross-sectioninthedisplayishighlightedintheimageviewer. TheNextLineoptiongraphsthelinesintheordertheywereentered.StoreCopymakesacopyofacross-

Figure15.Cross-sectiongraphforaline.Notetheaveragevalueofthecross-sectionmarkedonthey-axis.

Page 22: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 22

section graph to comparewith a graph fromadifferent line brought upusingNextLine.ClearCopiesremovesthecopiesofgraphs.

4-DSeriesAtime-seriesgraphisaplotofROIstatisticsfora4-D image where the x-axis is time (Figure 16).The fourthdimensioncanbe time(therefore thename)orany seriesof images (suchasdifferentcomponents from ICA analyses). Mango’s seriesgraphdefaultstoastaticROI(fixedpoint,line,2-D or 3-D) to create time series, so an implicitassumptionisthattheobjectwithintheROIisnotmoving in the time series. Mango provides anoption for dynamic ROIs for other series whentheobject ismoving (beatingheart)or if imagesofdifferentobjectsarepresentintheseries(ICAcomponents). In these latter examples ROIs areusedtotrackspatialratherthantemporalchanges.AstaticROIworkswellfornuclearmedicinestudiestoassessorganuptakeorclearanceofaradiotracer.StaticROIsalsoworkwell forrestingstate fMRIswheretimeseriescanbeusedtocalculateregion-to-regioncorrelations.DataforaseriesgraphcanbetheROImean,max,min,standarddeviation,sum,orvolume.Meanandsumareusefulwhentrackingthechangeinactivityofaradiotracer(PET,SPECT,etc.) or performing region-to-region analyses. Volume is useful when tracking volumechangesintimesuchastheleftventricleforabeatingheart.They-axisrangeforaseriesgraphisautomaticallysettomaximumandminimumy-values.Doubleclickingtotheleftofthey-axisopensadialogwindowwherethesecanbechanged.Mousepositionisindicatedasasmallcircleonthegraphalongwithtime(orseriesindex)andvalue.Clickingthemouseinthegraphsetsaverticalmarkerinthegraphandswitchesthe image in the viewer to the corresponding image in the series. Dragging the mouseacross the graph window changes images, providing control for reviewing the seriesimages.Aswithcross-sectiongraphs,acopyofagraphcanbetemporarilysavedforcomparisonwithothergraphs.Allgraphsdatacanbeexportedasacsvfileforfurtheranalysis.

Figure16.Time-seriesgraph.

Page 23: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 23

ImageCalculatorThe Image Calculator (found in the Viewer’s ImageMenu) isused to formulate amathematical equation tomanipulateimages,similartousingascientificcalculator(Figure 17). Numbers and simple math operators areentered into an equation from the calculator keypad.Images are entered into the equation using ‘this’ or‘other’ buttons. Pressing theCalculate button evaluatestheequation,performstheindicatedactions,andassignsresults toa ‘new’ imageor ‘this’ image (new inFig17).The equation can be formulated using numeric values,built-in functions, and images. Recently used equationscanberecalledusingtheShowHistorylisting.General. The image where the calculator is opened isreferenced inequationsas ‘this’.Otheropen imagesarereferred to as other(n) where ‘n’ is the order inwhichtheywereopened.The ‘other’buttonbringsupa listofimagesasother(n)alongwithfilenames(n=1throughthe number of other images open). When selected,other(n) is entered into the equation. In Figure 17 a new image is calculated as thedifference between ‘this’ image and another open image ‘other(1)’. The new image isassignedanamebasedonthisimage’snamewith‘-new’appended.

ProcessingControlTherearetwoprocessingcontrolcategories:

1. Region. If one or more ROIs are selected there are options to process 1) allvoxels,2)only inside theROI,or3)onlyoutside theROI. Option3 is good tozero out everything outside the ROI (e.g. background around the object ofinterest).

2. Options. If thecurrent image isa4-Dimage, thereareseveralalternatives: 1)apply to all series points (default) or 2) apply only to slices with ROIs. If atransform is in use then there is an option to apply it before performingcalculations.

MakeStatisticalImagefromaSeries…This option is only available in the viewer’s Imagemenu if the current image is 4-D. Asinglestatisticalparametricimage(mean,max,min,standarddeviation,orsum)isoutputbasedonvoxelanalysis in the4thdimension(timefor fMRI images). Processingrange is

Figure17.Imagecalculator.

Page 24: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 24

from starting image (or time point) to ending image (or time point). Statistics can becalculatedusinggroupsize=1uptosize=fullrange.Forexample,ifthereare10imagesinaseriesandgroupsizeis2theresultwillbeaseriesof5groupedimages(in4-Dformat)with stats calculated foreachgroup in the series. If groupsize is the sameas the rangethenonlyonestatisticalimageiscalculated(thedefault)

UsingMixedImagesArraySizesSomeimageprocessingsoftwarerequiresthatall imageshavethesamenumberofrows,columns, slices, and time points (i.e. identical array configurations) for algebraicmanipulation. However,Mangosupportscalculationsevenwhen imagearraysdiffer. TheprocessingschemaissimilartohowMangoperformsothermulti-imageoperationssuchascopying an ROI from one image and pasting it into another. In image coordinatemodeimagesarealignedaccording torow,col, slice, time=0,0,0,0. Inworldcoordinatemode(globeicon)imagesarealignedaccordingtox,y,z,t=0,0,0,0.Mangomanagesdifferencesinspacinganddatatypesregardlessof imagemode.Calculationsareonlydonewhereallimagesoverlap,whichcanvaryconsiderablywithmixedarrayconfigurations. Thearrayconfigurationoftheresultingimageissettomatchthatofthecurrent(this)image.Whenimageswithdifferingarrayconfigurationsareusedinacalculationwerecommendusingtheworldcoordinatemodeandthateachimagehaveaconsistent‘origin’.

MathematicalOperationsTheMathematical,Boolean,Statistical,andMiscellaneousmenusintheimagecalculatoreachprovidemultipleoptions.

MathematicalThis menu includes standard trigonometric functions and their inverses along withcommonmathematicaloperationssuchasabsolutevalue.Thevalueofπisincludedsinceitisoftenneededwithtrigonometricfunctions.Argumentsintrigonometricfunctionsarein radians. For example sin(π/2)=1 and asin(1)=π/2=1.57… An example use of thepowerfunctionis‘new=pow(this,1.67)’whichmakesanewimagebyraisingeachvoxelin‘this’ image to the1.67power. Asanotherexample, ‘this=sin(2π*row/128)’willmakeaoneperiodsinewaveacrosstherowsofanimagewith128rows.

StatisticalThis menu lists functions that return statistics calculated for this image. Two generalcategories are provided: 1) ROI stats (selected by index) or 2) Time Series stats (rangedesignatedasstartandend).TheROIstats functionsreturnasinglevalue. Separate functionsareprovided formean,minimum, maximum, standard deviation, and sum. For example, ‘new =bin(this>meanROI(0))’willmakeanewbinaryimagebasedontheconditionthatthisimageisgreaterthanthemeanvalueofROI‘0’inthisimage.IfmorethanoneROIispresenttheargumentcanbesettothedesiredROInumber.

Page 25: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 25

Timeseriesstatsreturnsan imagebasedon theselectedstats functionandrangewithinthe image series. For example, ‘new=meanTime(5,20)’ will return an image that is themeanvalueofimages5-20inthisseriesimage.

BooleanThis menu lists Boolean operators useful for formulating logical statements (the ‘AND’operator was used in a previous example). Characteristics of Boolean operators aredocumented inmany texts as well as a variety of websites. A particularly useful logicalfunction is if(condition,valueelsevalue). Forexample, ‘new=if(this>=other(1),thiselse0)’makesanewimagewithvaluesthatarefromthisimageiftheyaregreaterthanorequaltothoseintheother(1)imageandequaltozeroifnot.Thiseffectivelyusestheother(1)imageasavariablethresholdforthisimage.

MiscellaneousThis menu has several special features that do not fall within Mango’s other mathcategories. There are four special variables that automatically increment across rows,columns,slices,ortime.Forexample,‘new=rows’createsanewimagewherethevalueineachrowistherownumber,resultinginaramp-likeimage.Thesevariablescanbeusedinargumentsofotherfunctions.

Thevolume(value)functionisusedwhenthisimageisaseries.Itreturnsacopyofaseriesimagevolumewithindex=value.Forexample‘new=volume(13)’willcopytheimage(herecalledavolume)atindex13toanewimage.Themax(value,value) function returns themaximumvalue of the two arguments.Thisfunctioncanbeusedtocalculateanimagethatisformedasthemaximumvalueoftwoimages.Forexample‘new=max(this,other(2))’willmakeanewimagewhereeachvoxel is themaximumof that foundeither in this or theother(2) image.Themin(value,value)andremainder(value,value)operationsfunctionsimilarly.

Thebin(condition)functionreturnsabinaryvaluedimagebasedontestingalogicalcondition in the argument (returns 1 if condition is true and 0 if it is false). Forexample‘new=bin((this>100)and(other(1)<100))’willsetvoxelsinthenewimage=1wherevoxelsinthisimagearegreaterthan100andthoseintheother(1)imageare less than100. This function ishelpful for formingabinarymask forusewithotherimageprocessingtasks.The round(value), ceil(value), and floor(value) functions are used to convert afloating-pointvalue toan integer. Forexample, if this imagehas fractionalvaluesthen‘new=round(this)’willmakeanewintegerimageusingthe4-5roundingrule.Similarly, floor rounds down (negative direction) and ceiling rounds up (positivedirection).

Page 26: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 26

ImageTransformsThisoptionis intheViewer’sImageMenu. Whenselecteditopensanewdialogwindowwithcontrolstoapplya4x4affinetransformtotheviewer’simage(Figure18).Thereare12transformparametersthatcanbeadjusted(3-translate,3-rotate,3-scale,&3-skew).Theseparameterscanbeadjusted independentlyandtheireffectonthecurrent image isimmediatelyseen in theviewer.Thetransformremainsactivewhenthetransformedimageis overlaid onto another image, and can be used to interactively align two images. This isparticularly useful if landmarks to guide registration are not present (functional vsanatomicalimages)orifautomatedregistrationfails.Load…/Save…Transforms can besaved and loadedlater to apply tothe same image.The 4x4 affinetransform matrixisdisplayedbydefault(ShowMatrix),butyoucanswitchthistodisplaytheparametersofthe transform (Show Parameters) (Figure 18).Note:TheToolboxtransformiconwiththecurvedarrowcanbeusedtoturnthetransformon(blackarrow)andoff(greyarrow)toseetheeffectofthetransformontheimage. Transformparametersdifferdependingonworldorimagemodesandtheusercanselectwhichversiontodisplay.

Options…

PredefinedTransformsTwo predefined transforms are provided: 1) MNI to Talairach and 2) Talairach toMNI.ThesetransformsassumethattheimagehasbeenspatiallynormalizedtofittheMNIbrainspace (option 1) or the Talairach brain space (option 2). These transforms managedifferences in position (origins), orientation and size, but the origin may need to beadjusted to thatof theAC,since theorigin inTalairachspacediffersslightly fromthat inMNIspace.

CenterofRotationSeveraloptionsareprovidedtochangethecenterofrotationwhenapplyingtransforms:1)image origin, 2) image center (thedefault), or 3) current coordinate. Option1 ensuresthat image origins remain aligned. Option 2 is appropriatewhen the image centerwasusedasthecenterofrotationtoformulateatransform(commonpractice).Thekeyboard‘c’movescrosshairtotheimagecentertocheckoutthisoption.Option3providesawaytorotateaboutaparticularanatomicallandmark.

Figure18.Dialogwindowforcontrollingandviewingtransforms.

Page 27: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 27

Forward/InverseThisbuttonswitchesfromaforward(thedefault)totheinverseversionofthetransformmatrix. ThisoptionishelpfulwhentheloadedtransformwasdesignedtoadjustimageAtomatchimageBandyouneedittoadjustimageBtomatchimageA.

ConcatenateThis button is used to extend the range of an existing transform using concatenation(multiplyingthecurrent4x4transformmatrixbyanother4x4transformmatrixtomakeanet transform). When the Concatenate button is clicked the user can enter additionaltranslation,rotation,scale,andskewtotheprevioustransform.Thechangeswillbeseenimmediately in thedisplayed transformand transformed image.There isno limiton thenumber of concatenation stages, but more than two seem unreasonable. Thisoption ishelpfulwhentherangeofthetransformneededisgreaterthatprovidedbytheslidersforasingletransform.

UndoFollowing concatenations, the undo buttonreverses this action removing the lastconcatenation each time it is pressed. Forexample,ifyouusedtwoadditionalconcatenatedtransforms these can be removed by clickingundo twice. Undo canalsobeused to removeasingletransform(clearsallsettings).

ImageFiltersThisoption is in theViewer’s ImageMenu.Theusercanselect froma listofbuilt-inanduser-defined filters. Filters can be 1-D (temporal), 2-D (slice) or 3-D (multi-slice).Temporal and spatial filtering can both be applied to a 4-D image. Most filters actimmediatelywhen selected, but theRank Filter opens a dialogwindowwith options forsize, type (min, max, median), and extent (slice,image volume, time), providing customizationbased on needs. NOTE: Filtering operationscannotbeundone,butreloadwillresettheimageto itsunfilteredstate. Thebuilt-infiltersshouldbeadequatefornormaluse,butthosewithknowledgeandexperienceinfilterdesignshouldenjoymakingfilters customized for their applications using the‘Add/Edit Filter…’ option from theToolboxOptionsmenu.

SurfaceRenderedImages

Figure19.Surfacedisplaywithzoomedversionoftrianglesfromasmallregiononthesurface.

Figure20.Brainsurfacewithorientationandaxes(blue).

Page 28: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 28

Mango provides viewing and analysis capabilities for surface images synthesized fromvoxel-basedimages(Figure19).Surfaceimagescanbedynamicallymovedandrotatedforviewinganobject’s surface fromanydirection.Surface-basedanalysis toolsareprovidedformeasuring distances (straight line and along a surface), angles, volumes and surfaceareas. ROIs and overlays from the voxel-based image can be formulated as secondarysurfaces(calledshapes).

SynthesisAuserselectedthresholdvalueisneededtodistinguishsurfacevoxelsinthevoxel-basedimagefromthoseexternalor internal toanobject. Thisapproach issimilar tothatdonewhen using thresholds to define an ROI. A shrinkwrap ROI is used by default to recordcoordinatesalonganexternalsurface.The‘MarchingCubes’algorithmusescoordinatesofthesurfacevoxelsasinputtoassemblealargenumberofconnectedtrianglestessellatingtheobjectssurfaceinamesh-likemanner(Figure19,right).

ViewingAshadingmodel,where lightreflected fromthesurfacesof trianglesvaries inbrightnessbased on orientation, provides a realistic three-dimensional appearance for the surfaces(Figures19-21). Bydefault, surfaces facing the screenwill bebright and thoseorientedperpendicularwillbedark,enhancingvisualizationofthesurface’slandscape.Mangousessmooth shading such thatbrightnessvaries smoothlyacross the surfaceof triangles (Fig20). The mouse pointer in the surface display window is similar to that in the viewer,where thepointer’s surface x-y-z location is indicated in theToolboxwindow. Draggingthispointeracrossthescreenchangestheobject’sorientation,allowinguserstoviewtheobject’s entire surface. Zooming and panning controls are similar to those in the imageviewer,andadditionallythescrollwheelcanbeusedto zoom. The large crosshair in the surface display(blue)issynchronizedwiththatintheimageviewer(also blue). To position the large crosshair at thesurface,double-clickwiththemousepointeroverthedesiredposition.Thematerialpropertiesofasurfaceusedinshadingcanbechangedincludingcolorofreflectedlightandtransparency.Lightingpropertiescanbechangedforsurface reflection characteristic (specular, diffuse)and for the brightness and position of the lightilluminatingthesurface.Thesurfaceviewercanprovidesimultaneousdisplayofsurfacesandsliceswherethesurfaceiscutawayandslicesdisplayedinplaceofthecut-awayportion. Slicescombinedwithsurfacesinthismannerarecalledcutplanes(Figure21).

Figure21.Surfacecut-awaytodisplayaxial,sagittal,andcoronalcutplanes.

Page 29: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 29

SurfaceAnalysisMangoprovides fourbasicmeasurements for surfaces:distance,angles, surfaceareaandvolume.RulerandAngletoolsareselectableontheViewmenu. Thesearedynamictoolsthatcanbemovedaboutsurfacestomakemeasurementswhileviewingandrotatingthesurfaceintopositionasneeded.Anotherdistanceoptionisbasedonpointsplacedonthesurface.PointROIsareplacedonthesurfaceusingshift-double-click.Linescanbedrawnbetweenpointsorbetweenpointsandthe largecrosshair location(whether insideoronthesurface).Linescanbeeitherastraight-linebetweenpoints(similartotheRuler)orapath along the surface between surface points. Thepath option is not providedwith theRuler.Manypathsarepossiblealongthesurface,sowechoseapaththatliesinaspecificplane passing through the two endpoints, where the plane is orientedmidway betweentheirnormalvectors.Thepathisattheintersectionofthisplaneandthesurface.Surfacepoints defining the line can be selected using the shift-double click action, moved anddeposited elsewhere with a click. All lines associated with the moved point are thenupdated.Anobject’ssurfaceareaiscalculatedasthesumofareasofthetrianglescoveringthesurface,andmostofthesewillbeverysmallcomparedwiththesurfacespanned.Forbrainsurfaces, therearehundredsof thousandsof triangles. Surface-baseddistancesandsurface areas are properties only obtainable from the surface image, not possible from thevoxel-basedimage.ThevolumeofasurfaceiscalculatedusingaformofGauss’sDivergenceTheorem(relatingsurface properties to the volume inside the surface) Eberle et al., 1991, Lancaster et al.,1992.Thesurface-basedvolumecalculationisfasterthancountingthecorrespondingROIsvoxels in the base image. Volumes calculated from surfaces of paired ROIs from voxel-based images are slightly different (1-2%). This is due in part to differences in surfacethresholds,differencesinconnectivityrulesusedduringsurfacesynthesis,anddifferencesduetodecimation(reductionofnumberoftriangles)whenfinalizingthesurfacemodel.

ShapesMango supports adding additional surface objects asshapesderivedfromoverlaysand/orROIs inthevoxel-basedimage.Thecolorofashapeobjectisbasedonthecolor of the overlay or ROI from which it is made.Transparencyofthebaseobject’ssurfacecanbereducedtohelpvisualizeanenclosedshape(~50%inFigure22).Multiple shapes are supported, one from each overlayand/or ROI. Colors are assigned to distinguish each.Analysisofshapesisthesameasforsurfaces(distance,angles, surface area, & volume). Viewing of surfaces,shapes, slices, andROIs can be turned on and off fromthe surface viewer’sViewwindow. Toplacepointsandlinesonshapesyoumustfirstturnthesurfaceviewofftouncoverthem. Pointsareplacedonthefirstsurfaceencountered,ontheoutersurfaceevenifthesurfaceistransparent.

Figure22.Superioraspectviewofabrainsurface(transparency=50%)withthedefaultmodenetworkasashape(red).

Page 30: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 30

VolumeRenderedImagesVolume rendering provides a variety of viewing options for voxel-based images using atechniquecalledraytracing.Aray followsastraight-linepathpassingthroughtheobjectperpendiculartothedisplayplane.Eachpixelinthedisplayisassociatedwithasingleray.Duringraytracingallvoxelsalongtheray’spathareinspectedandarayvalueassignedtotheassociatedpixel.Acommonrayvalueisthemaximumvoxelvaluealongtheray.Mangosupportstwootheroptions;medianandminimumrayvalue.Thedisplayedbrightnessofthe volume rendered image is proportional to ray values. This option is found in theviewersImage/BuildProjection…menu.Itwouldbehelpfultodynamicallychangeobjectorientationforviewingvolumerenderedobjects as provided for surface viewing. However, volume rendering is much morecomputationally demanding than surface rendering, and without special hardware fullmotion dynamic control of object orientation is not practical. Alternatively, dynamicviewing is possible when the desired views can be precalculated. In Mango, volumerenderedprojections(views)canbecalculatedforrotationaboutoneofthethreemajor3-Daxes. Thevolumerenderedviewscanthenbeanimatedfordynamicallyviewingwhiletheobjectisrotatedaboutthechosenaxisprovidingfull-circleviewing.

AdditionalInformation

SpecialFeatures

FindOverlayClusters…Athresholdedoverlaycanbemadeupofmultiplenon-connectedregions.Itispossibletocollecttheseintoasetofclustersusingthe‘FindOverlayClusters...’optionintheAnalysisMenu.Forexample,thisprocessingishelpfultobreakupICAcomponentsderivedfromaresting state fMRI study into separateparts.Adialogwindowopenswhen this option isselectedandautomaticallyidentifiesthelargesteightnon-connectedregionsorclusters,orfeweriftherearelessthaneight.Thestatisticswindowcanbeopenedusingthetooliconontherightsideoftheclusterdialogtoreviewstatsofeachcluster. Userscanchoosetoadjustthenumber(n)ofclusterstogenerate.TheselectednumberofclusterscanthenbeconvertedtoseparateROIsusingthe ‘CreateROIsofclusters’optionintheclusterdialogtoolmenu.OnceconvertedtoROIsindependentanalysesarepossible.

CreateLogicalOverlaysWhenmorethanoneoverlayispresentitishelpfultocolorcodetheiroverlappingvolumes.The‘CreateOverlayLogicals...’optionintheAnalysisMenudoesthis.Thisoptionsupportsmorethantwooverlays(eachwithadifferentcolortable)andthenumberofcombinationsis automatically set up and calculated. The statistics window can be opened to review

Page 31: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 31

resultsforoverlappingregions.Similartoclusters,thelogicalregionscanbeconvertedtoROIsforfurtheranalyses.

AddParametricOverlay…Thisoption is in theViewer’sFileMenu. It isusedwhenthesource image foroverlayinghasbothpositiveandnegativevaluesofinterestsuchasz-scoreimages.Whenselectedthefiledialogisopenedandtheuserselectstheimagetooverlayontothecurrentviewer.Thisoptionassignstwocolortablestotheoverlay,onefornegativevaluesandoneforpositivevalues,whichcanbeadjustedindependently.

LoadOnlineOverlay…ThisoptionisintheViewer’sFileMenu.ItisusedtoloadanimageasanoverlayusingaURLforimagesarchivedatawebaddress.

LoadOnlineROI…Thisoption is theViewer’sFileMenu. It isusedto loadROIsusingaURLthathavebeenarchivedatawebaddress.

SimpleHowTo…

EditOriginTheusercanchangethesitetouseastheoriginforanimage.Ifnotdefinedintheimageheader the default origin is the center of the image array. If desired, the origin can bechanged to match the column-row-slice of a specific landmark within an image. Todeterminewheretheoriginiscurrentlylocatedpressthe‘o’keyandthecrosshairwillbepositionedthere.Ifadifferentoriginisdesiredusethemousetonavigatethecrosshairtothedesiredlocation(or ‘esc’andenterthecoordinate)thenselectthe ‘Origin…’optionintheViewer’sEditMenu.Asmalldialogwillopenwiththecurrentcol-row-sliceoriginnearthetopandthecurrentcol-row-slicecrosshairpositioninthex-y-ztextbox. PressingOKsetstheorigintothevaluesinthex-y-ztextbox. Youcantypeincol-row-slicevaluesfortheoriginifyouknowthem.Savetheimagetomakechangespermanent.

EditVoxelValueThe‘Voxel…’optionintheViewer’sEditMenuprovidesameanstoviewavoxel’svalueatthe location of the crosshair and to change it. Wemostly use this option to set pointsoutsideanobjectofinteresttotrackmovementwhenapplyingacoordinatetransformortotrackthechangeinresolutionwhenfiltersareapplied.Savetheimagetomakechangespermanent.

EnterNotesThe‘Notes…’optionintheViewer’sEditMenuiswherecommentsspecifictoanimagecanbe entered. Suggestions include project title, subject code, transforms applied, filtering

Page 32: Introduction 3 Display 5 - Research Imaging Instituteric.uthscsa.edu/mango/downloads/Using_Mango.pdfUSING MANGO 4.0 Jack L. Lancaster & Michael Martinez 1 TABLE OF CONTENTS Introduction

USING MANGO 4.0

JackL.Lancaster&MichaelMartinez 32

done,etc.DonotplaceHIPPArestrictedinformationhere.Savetheimagetomakechangespermanent.

UpdateDisplaytoFullRangeThemaxandmindisplaysettingusedbyothersaresavedinanimage’sheadersothatthenexttimetheimageisopenedtheuserwillviewtheimagewiththesamesettings.Tosetthe max-min range to the full range of image values click the ‘Update to Image Range’optionintheViewer’sEditMenu.Savetheimagetomakechangespermanent.

ReviewImageHeaderInformationImage header information is accessed using the ‘Image Info’ option in the Viewer’s FileMenu. Optionally,press‘commandandi’keys. Two levels of information are provided astabsinthedialogwindowforthisoption:

SummaryTabThesummaryinformationisasubsetoftheimageheaderformattedforeasyreading(exampleinFigure2).Itincludesthefilenameandlocationaswellaskeydatathatareneededtoproperlydisplayimagesandmakemeasurements.

HeaderTabThe informationat the ‘Header’ tab is formattedas text tagsanddata fromthetrueimage header. The most extensive image header is that for DICOM images. Fortraditional multi-slice DICOM images each slice’s data is in a different file with adifferent header. Mango has a next button to move to different slices; however,movingthecrosshairtothesliceofinterestwillalsobringupthecorrespondingsliceheader.Sinceheaderscontainagreatdealoftextanddataspecifictagsweprovidedan option to search within the header. Header data can be edited if incorrect ormissing,butbecarefulbecauseenteringincorrectdatainkeyfields(rows,cols,slices,etc.)maymaketheimageunreadable.