Leaf GUI User Manual

download Leaf GUI User Manual

of 28

Transcript of Leaf GUI User Manual

  • 8/7/2019 Leaf GUI User Manual

    1/28

    LEAFGUI:UserManual(LeafExtractionandAnalysisFrameworkGraphicalUserInterface)

  • 8/7/2019 Leaf GUI User Manual

    2/28

    LEAFGUIUserManual Priceetal.

    Index

    Howto

    cite

    the

    LEAF

    GUI..Page

    3

    Introduction..Page3

    Installation..Page 4OverviewoftheLEAFGUIlayout.Page5

    LEAFGUIOperation........Page 6SettingtheScale.Page6ImageCropping..Page6Thresholding.Page 7ImageStorageandAreaMask.Page9CleaningtheBinaryImage.Page10ImageSegmentation..Page 13SummaryStatistics.Page14UsingtheQueuePage17ClearingtheCurrentImages.Page18UndoingthePreviousStepPage18InterruptingtheGUI..Page18DropDownMenus..Page19

    Caveats...Page25Contacts.Page27Table1:HotKeys.Page28

    2

  • 8/7/2019 Leaf GUI User Manual

    3/28

  • 8/7/2019 Leaf GUI User Manual

    4/28

    LEAFGUIUserManual Priceetal.

    4

    MatlabandmanyofthefunctionalaspectsoftheLEAFGUIrelyonspecificfunctionsfromthe

    Matlabimageprocessinglibrary.Weprovidebriefdescriptionsofsuchfunctionshereandrefer

    theusertotheMatlabdocumentationforsomeofthemorecomplicatedoperations.

    InstallationThecodefortheLEAFGUIsoftwareiswritteninMatlab.However,thankstoMatlabsGUI

    developmentenvironment,theGUIcanbecompiledasastandaloneexecutablethatcanrun

    onmostplatforms.Sourcecode,downloadinstructionsandversionscompiledforPCs,Macs

    andLinuxoperatingsystemsareavailableatwww.leafgui.org.

    http://www.leafgui.org/http://www.leafgui.org/
  • 8/7/2019 Leaf GUI User Manual

    5/28

    SetthescaleCroptheimage

    Adaptive

    Thresholding

    Global

    Thresholding

    AreaMask

    Dropdownmenus OriginalImage

    Window

    Modified

    Image

    Window

    OriginalZoom

    OutputPreference

    (xlsortxt)SummaryStatistics

    Options

    Image

    Segmentation

    Options

    CleanBinaryImageOptions

    Zoom

    Rectangle

    (movable,resizable)

    SendtoQueueUndo!

    ClearImagesInterrupt!

    ImageStorage

    Combine

    Images

    LEAFGUIcontainssevenoperationalpanels,SetScaleandCrop,Filtering,Thresholding,ImageStorage,CleanBinaryImage,

    Statistics.Inthefollowingsectionswedescribethefunctionalitiesofthepanels.LEAFGUIalsohasfourdisplaypanels,OriginalImage

    displayingtheirrespectivezoomedregions.ThereisalsoaQueueontherighthandsideoftheGUIwhereuserscanstorethumbnailso

    OverviewoftheLEAFGUIlayout

  • 8/7/2019 Leaf GUI User Manual

    6/28

    LEAFGUIOperationWenowdescribeoperationsonleafimageswhichcanbeperformedusingleftsidepanelsof

    themainwindow(seeOverviewabove).Weassumethatauserhasalreadyloadedanimageof

    aleaf(seeFile>OpenImageinDropDownMenussectionforinstructionsonhowtoloadan

    image).SettingtheScaleThispanelallowstheusertosetthescale,inpixelspermillimeterfortheimage. Ifthescaleis

    knownforexample,50pixelspermm,theusercanenterthis

    valueandproceed(Figure1).Alternatively,iftheimage

    containsascalebar,theusercanenterthelengthofthe

    scalebarinmm,thenclickonthesetscalebutton(Demo

    Video2).Whentheuserplacesthecursorovertheraw

    image,crosshairswillappear.Theuserthenclicksateither

    endofthescalebar,thendoubleclicksonthebaritself.Thenewlycalculatedscale,in

    pixels/mmwillappearinthescalewindow.Notethatthecalculationofsummarystatisticssuc

    asareoleorveindimensionsrequiresthattheuserenterorsetthescale,andifthescaleisnot

    enteredwhenselectingtheseoptions,anerrormessagewillappear.Becausemanyusers

    beworkingwithcollectionsofimagesthatallhavethesamescale,thescaleisnotresetwhen

    userclearstheimages(seeClearImagesbelow).

    h

    will

    a

    Figure1Settingthescaleandcroppingpanel.

    ImageCropping

  • 8/7/2019 Leaf GUI User Manual

    7/28

    LEAFGUIUserManual Priceetal.

    Therearetwoimagecroppingoptions

    available,rectangularandpolygonalcropping

    (Figure2).Rectangularcropping,whichwill

    likelybethepreferredchoiceofmostusers

    duetoitseaseofuse,isavailableasabutton

    onthemainguipanel(Figure1),while

    polygonalcroppingcanbefoundonthe

    Imagedropdownmenu.Bothoptionsallow

    theusertocropawayunwantednoisethat

    occursaroundtheleafimage,orfocusona

    regionofinterest. Polygonalcroppingallows

    theusertoplacepointsaroundtheregiontheywanttocropbyclickingamouse.Whenthe

    regionofinterestisclosed,anewrectangularimagewillbeformedthatjustenclosesthe

    polygon.Blackpixelswillpadtheimagetoformarectangle.Alternatively,theusercanplacea

    rectanglearoundtheleaforregionofinterest.Thisapproachtypicallyyieldsthebestresultsas

    itdoesnotcreateblackregionsaroundthedesiredregionthatmustbedealtwithlater(see

    DemoVideo3).

    Figure2.Polygonandrectangularcroppingoptions.

    ThresholdingThethresholdingoptionswithintheLEAFGUIallowtheusertoconvertRGBorgrayscaleimages

    intobinaryimages(1sand0s).Thisisacriticalstepasalmostallsubsequentcleaningand

    segmentationfunctionswithintheLEAFGUIactonbinaryimages.Therearethreeoptions

    withinthethresholdingbuttongroup: adaptivethresholding,globalthresholding,ora

    7

  • 8/7/2019 Leaf GUI User Manual

    8/28

    LEAFGUIUserManual Priceetal.

    8

    combinationofthetwo(Figure3). Adaptivethresholdingisan

    approachthattakesintoaccounttheunevenilluminationofmany

    leafimages.Tocorrectforthis,adaptivethresholdingusesalocal

    window,thesizeofwhichinpixelsissetbytheuser.Thiswindow

    isthenmovedacrosstheimageandpixelsareseparatedinto

    foregroundandbackgrounddependingonwhethertheirvaluesare

    greaterthanthethresholdlevelsetbytheuser.Inaddition,we

    provideaglobalthresholdingoption.Globalthresholdingfirst

    convertstheimagetograyscale,thenseparatesforegroundfrom

    backgroundbasedonwhetherthepixelintensitiesaregreateror

    lessthanthethresholdlevel.Bothadaptiveandglobalthresholding

    utilizesliderstosetthethresholdlevelswhichcanspeeduptheprocesswhentryingmultiple

    levelsouttoseehowwelltheysegmenttheimage.

    Wehavefoundthatacombinationofbothadaptiveandglobalthresholdingworksbest

    onimagesofclearedleaves:adaptivethresholdingtendstocapturesmallveinsbetterwhile

    globalcaptureslargeveinsbetter.Tocombineimages,firstutilizetheadaptiveapproachtoget

    theModifiedImagewhereyouwantit.BycheckingtheAdaptiveImagecheckboxatthe

    bottomoftheThresholdingpanel,theuserstoresacopyofthethresholdedimageandan

    additional

    copy

    is

    sent

    to

    the

    Queue

    (see

    below).

    This

    applies

    to

    global

    thresholding

    as

    well,

    and

    oncebothboxesarechecked,theuserpressestheCombinebutton,andthetwothresholded

    imagesarecombinedintoasingleimagewhichisnowdisplayedintheModifiedImagepanel

    (seeDemoVideo4).

    Figure3ThresholdingPanelwithCombiningoption.

  • 8/7/2019 Leaf GUI User Manual

    9/28

    LEAFGUIUserManual Priceetal.

    9

    ImageStorageandAreaMaskMany

    of

    the

    cleared

    leaf

    images

    we

    have

    processed

    have

    significantnoisearoundtheleafimageitselfthatremainsin

    theimagesevenafterthresholdingsteps.Therearemultip

    approachesbywhichtheusercouldremovethatnoise

    includingcroppingorcombinationsofoptionswithintheClean

    BinaryImagepanel(seebelow),butwehavefoundthatsimply

    creatingabinarymaskoftheleafimageisbyfarthefastestapproach.Todothistheuserfirst

    setstheglobalthresholdinglevelhighenough(orlowenoughdependingonimagedetails)so

    thatallthepixelswithintheinterioroftheleafareblackandthebackgroundiswhite.Often

    therearestillregionsthatneedtoberemovedandthiscanbeaccomplishedthroughthe

    RemoveRegionsoptionintheCleanBinaryImagepanel(seebelow).Oncetheuserissatisfied

    withthesegmentationandcleaning,theusercreatesacomplementoftheimagewhichisthen

    storedbycheckingtheAreaImagecheckboxwithintheAreaMaskpanel,whichalsosendsa

    copytotheQueue(Figure4).Theimageisnowstored,andcanbeusedinsubsequentstepto

    removebackgroundnoisebypressingtheMaskbutton(DemoVideo4).Thismultiplies

    whateverimageisintheModifiedImagewindowbythestoredimagemask.Theresulting

    imagecontainsonlythepartoftheOriginalImagethatwouldbecontainedwithinthewhite

    Maskregion.

    le

    CheckingtheAreaImage,VeinImageorSkeletonImagetabscausesacopyofthese

    imagestobesenttotheQueueforfutureuseifneededandasverificationtotheuserthatthe

    Figure4.AreaMaskPanelwithArea,VeinandSkeletonimagestorageoptions.

  • 8/7/2019 Leaf GUI User Manual

    10/28

    LEAFGUIUserManual Priceetal.

    imageshaveindeedbeenstored.Inaddition,theoptiontostoreacopyoftheVeinImageand

    SkeletonImagegivestheusertheoptiontomanuallyinspectthesetwosteps,modifyingthe

    imagesifdesiredbeforecallingtheVeinStatsalgorithm.Inaddition,ifcopiesoftheseimages

    arestored,theyareusedintheBinaryw/Edges,NodesandTipsvisualizationoptiondescribed

    below.

    CleaningtheBinaryImageTherearemultipleoptionsintheCleanBinaryImagepanelthatallowtheusertoimprovethe

    qualityoftheleafveinimagebeforeitissaved,orpassedtosubsequentstatisticsalgorithms

    (Figure5). Asindicatedbythepaneltitle,allofthealgorithmsinthesectionworkonbinary

    images,thus,theimageintheModifiedImagewindowmustbebinaryinorderforthese

    algorithmstowork.

    RemoveRegions(Ctrl+R)thisstepremovescontiguouswhitepixel

    regionswhosenumberofpixelsisequaltoorlessthanthevalue

    setbytheuser(1000inFigure5).Theactualvaluethattheuser

    utilizesheredependsentirelyontheimage,desiredoutcome,and

    thecomfortleveloftheuserinthewholesaleremovalof

    contiguousregions:usewithcaution(DemoVideo6).

    Figure5CleanBinaryImagepanel.

    RemovePerimeter(Ctrl+P)removesasinglepixelwideperimeter

    oftheleaf(whitepixels).Thisstepcanberepeatedasmanytimes

    asneeded(DemoVideo6).

    10

  • 8/7/2019 Leaf GUI User Manual

    11/28

    LEAFGUIUserManual Priceetal.

    RemoveLabeled(Ctrl+L)thisbuttonopensupanewpopupwindow.Withinthewindow,any

    contiguousblackpixelregionsareidentified,labeled(theyareassignedaspecificsequential

    numericalidentifier)andrandomlyassignedacolortoallowtheusertobetteridentifyseparate

    regions.Thecursorarrowisreplacebycrosshairs,andtheusercannowclickonanyregions

    whichheorshewantstoremovefromtheModifiedImage.Aftertheuserisfinished,pressing

    theEnterbuttononthekeyboardbringsupanewimagewithanewcolorschemeinwhichall

    regionstheuserselectedhavebeenremoved.Anadditionalpopupwindowopensaskingifthe

    userwouldliketoremoveanyadditionalregions.Selectingyesreturnstothepreviousstep:

    selectingnoreturnstheimagelabeledimagetotheprimaryGUIwindow(DemoVideo6).

    RemoveSpurs(Ctrl+S)removesanywhitepixelsthatareconnectedtoonlyasingleother

    whitepixel(either4connectedor8connected).Thisstepcanberepeatedasmanytimesasis

    necessary,andcanbeperformedbothonthestandardbinaryimage(whiteveins,black

    background),orthecomplementofthatimage(whitebackground,blackveins)toimprovethe

    performanceoftheEdgeStatsalgorithm,byremovingspuriousedges:usewithcaution(Demo

    Video6).

    FillRegions(Ctrl+Y)thisbuttonopensupanentirelyseparatepopupwindow.Withinthis

    window,theuserinteractivelyplacesthecursor(crosshairs)byclickingwithintheimageto

    formapolygon.Whenthepolygonregionisclosed(acirclewillformwhenthecursorisplaced

    over

    the

    first

    vertex),

    the

    popup

    window

    closes,

    and

    the

    region

    that

    the

    user

    created

    is

    now

    filledwithwhitepixelsintheModifiedImage(DemoVideo6).Thisstepcanbeusedtoremove

    noiseortofillinveinregionsthattheuserthinksshouldbefilled.

    11

  • 8/7/2019 Leaf GUI User Manual

    12/28

    LEAFGUIUserManual Priceetal.

    ClearBorder(Ctrl+B)thisstepremovesanycontiguouswhitepixelregions,suchasunwanted

    noise,thatoverlaptheimageborder(DemoVideo4).

    Skeletonthisbuttonreducestheveinimagetoitsskeleton,whichisasinglepixelwide

    representationofthenetwork.Thiscanbedoneiterativelybyclickingthebuttonrepeatedlyor

    entirelybyinvokingtheSkeletonizeFully(Ctrl+F)optionintheCleanBinarydropdownmenu.

    TheskeletonisintegralintheEdgeStatsalgorithm,sovisualizingtheskeletonwillbeimportant

    forverifyingthatthereisgeneralagreementbetweentheskeletonimageandtheoriginal

    image.ThiscanfurtherbevisualizedusingsomeoftheoptionsintheCompositedropdown

    menu:eitherOriginalw/SkeletonorBinaryw/edges,nodesandtips(seebelow).

    ImageComplement(Ctrl+K)thissimplycreatesacomplementoftheimage (0sbecome1s,

    1sbecome0s)intheintheModifiedImagewindow,whetherbinaryorRGB(DemoVideo6).

    CreativeuseoftheImageComplementoptionexpandsthemethodsbywhichtheusercan

    cleanthebinaryimagebeforepassingittothestatisticalgorithms.

    FullorZoomRadioButtonsthesemutuallyexclusivebuttonsallowtheusertospecify

    whethertheywanttheoperationswithintheCleanBinaryImagepaneltobeperformedonthe

    entireimage(Fulloption)oronlywiththeregiondelineatedbythezoomwindow(Zoom

    option)(DemoVideo6).Thiscanbeahelpfulstepifnoiseisunequallydistributedwithinthe

    ModifiedImage.

    12

  • 8/7/2019 Leaf GUI User Manual

    13/28

    LEAFGUIUserManual Priceetal.

    ImageSegmentationTheImageSegmentationpanel(Figure6)allowstheuserto

    transform

    the

    leaf

    vein

    image

    using

    several

    methods

    that

    highlight

    aspectsoftheimagethatareusedinsubsequentstatistical

    algorithms.TheseimagescanbesavedintheQueue(seebelow)

    tobeusedfordemonstrationpurposes,orforpublication.

    LabelLeafVeinsthisstepidentifiescontiguouswhitepixel

    regions(leafveins)andassignseachaspecificsequentialnumericalidentifier.Eachregionis

    thenrandomlycolorcodedtoallowtheusertovisualizehowwelltheveinnetworkis

    connected.Anentirelyconnectednetworkwouldbeasinglecolor;whileadisconnected

    networkwouldhaveseveralcolors(seeDemoVideo7).

    Figure6ImageSegmentationPanel

    LabelAreolesthisstepisidenticaltotheLabelLeafVeinsstepexceptthatareolesinsteadof

    veinsarelabeledandrandomlycolorcoded. Theregionsidentifiedherearethesamethose

    thatwillbeprocessedbytheAreoleStatsalgorithminthefollowingsection(seeDemoVideo

    7).

    BinarizeRGBthisbuttonconvertsanRGBimageasmightbecreatedinthepreviousstep

    (LabelAreoles)intoabinaryimage(DemoVideo7).

    13

  • 8/7/2019 Leaf GUI User Manual

    14/28

    LEAFGUIUserManual Priceetal.

    SummaryStatisticsTheSummaryStatisticspanelcontainsthebuttonsthatinvokethealgorithmsthatwilllikelybe

    of

    greatest

    interest

    to

    most

    users.

    Note,

    while

    we

    have

    made

    every

    effort

    to

    optimize

    these

    algorithmsforspeed,forlargeleavesorlargeleafimages,theycantakesometimeto

    complete,sobepatient.

    AreaStatsthisbuttoncalculatestheareaandperimeteroftheentireleaf.Theareaisdefined

    asthetotalnumberofpixelsintheimagetimesthescalefactorsquared(mm/pixel)2.The

    perimeteristhelengthinpixelsoftheboundaryaroundthecontiguousbinaryleafimagetimes

    thescalefactor(mm/pixel).Forreference,thescalefactorisalsoincludedintheoutputofthis

    algorithm.

    Figure7SummaryStatisticPanel

    AreoleStatsthisbuttoninvokesanalgorithm thatcalculates

    anumberofdifferentstatisticsforeachindividual areoleinthe

    image.ThesearereturnedasaTextfileorasa tableinan

    Excelspreadsheetdependingonuseroutput preferences

    (Figure7).Whenclicked,adialogboxwillopen askingifthe

    imagetobeprocessedhasbackgroundornot.If theimageis

    forexampleanentireleafsurroundedbyblackbackground,theanswerisyes.Iftheimageisa

    subsamplewithintheleaf,theanswerisno.Theunderlyingalgorithmcalculatesstatisticsforall

    contiguousblackregionsintheimage,ofwhichthebackgroundisone,soinansweringthis

    questiontheuserisessentiallyremovingthebackgroundfromthestatisticsreturned.Notethat

    ifprocessingasubsampleofanimage,theuserwillprobablywanttoremoveareoles

    overlappingtheborderastheyarenotcomplete.Thiscanbedonebycreatingacomplementof

    14

  • 8/7/2019 Leaf GUI User Manual

    15/28

    LEAFGUIUserManual Priceetal.

    theimageandusingtheClearBorderbuttonintroducedpreviouslyandcreatinganimage

    complementagain(seeDemoVideo8).

    Thestatisticsreturnedinclude:

    1)AreoleNumber,theuniquenumericalIDassignedtothatareole,from1tothenumberof

    areoles.

    2)AreoleArea(mm2),thenumberofpixelsineachareoletimestheareaofasinglepixel.

    3)ConvexArea(mm2)theareaoftheconvexhullthatjustenclosestheareole.

    4)Eccentricity(dimensionless,rangebetweenzeroandone)thisistheratioofthedistance

    betweenthefociofanellipseanditsmajoraxis.Theellipsehasthesamenormalizedsecond

    momentofareaastheregion.

    5)Solidity(dimensionless,rangebetweenzeroandone)thisistheratiooftheAreoleAreatoits

    ConvexArea.

    6)Perimeter(mm)thedistancearoundtheboundaryofareole.

    7)EquivalentDiameter(mm)thisisthediameterofacirclethathasthesamenormalized

    secondcentralmomentsastheregion.

    8)MajorAxisandMinorAxis(mm)oftheellipsethathasthesamenormalizedsecondcentral

    momentsastheregion.

    9)Centroid(coordinates,x,y)thecenterofdensityoftheregion.

    10)

    Mean

    Distance

    (mm)

    the

    average

    Euclidean

    distance

    between

    each

    areole

    pixel

    and

    the

    nearestveinpixel.

    11)VarianceDistance(mm)thevarianceintheMeanDistance.

    15

  • 8/7/2019 Leaf GUI User Manual

    16/28

    LEAFGUIUserManual Priceetal.

    AnexampleofatablewithstatisticsfromtheAreoleStatsoutputcanbeseenontheLEAFGUI

    website.ForfurtherinstructionseeDemoVideo8.

    VeinStatsthisinvokesanalgorithmthatreturnsthefollowingstatistics:

    1)EdgeNumbertheuniquenumberassignedtoidentifythatedge,from1tothenumberof

    edges.

    2)Length(mm)thelengthoftheedge.Thisiscalculatedasthedistancealongtheskeleton,

    withthedistancebetweenpixelssharingaboundaryas1andthedistancebetweenpixels

    connectedbytheircornersasthesquarerootof2.Thesedistancesarethenconvertedtomm

    usingthescalepreviouslysetbytheuser.

    3)Width(mm)a.k.a.diameter,iscalculatedusingthedistancetransformtofirstidentifythe

    distanceofallveinpixelstothenearestareolepixel.Thedistanceofeveryskeletonpixel

    (radius)isthendoubledandmultipliedbythescalefactortoequal(approximately)the

    diameterofeachedgeatthatpoint.Eachskeletonpixelthereforehasacorresponding

    diameter,andtheaverageacrossallofthediameterswithinagivenedgeisthentheWidthof

    thatedge.

    4)Area(mm2)iscalculatedasthesumoftheWidthateachskeletonpixelasintheprevious

    steptimesthelengthofasinglepixelacrossalloftheskeletonpixelscontainedwithinagiven

    edge(seemainmanuscript).Thisisthe2Dareaofeachedge.

    5)

    Surface

    Area

    (mm

    2

    )

    is

    calculated

    using

    the

    same

    approach

    is

    the

    previous

    step,

    except

    that

    eachskeletonpixelistreatedasthecenterofacylinderinsteadofarectangle.Thediameter(d)

    ofthecylinderisascalculatedabove.Thelength(lorheight)ofthecylinderislengthofasingle

    pixel,andthesurfaceareaisthecalculatedusingthefamiliarformulaforthesurfacearea(SA)

    16

  • 8/7/2019 Leaf GUI User Manual

    17/28

    LEAFGUIUserManual Priceetal.

    ofacylinder(notincludingends),SA=2p(d/2)*l.Thetotalsurfaceareaofanedgeisthenthe

    sumofalloftheindividualcylinderscorrespondingtoeachskeletonpixel.

    6)Volume(mm3)iscalculatedinthesamewayasSurfaceArea,excepttheformulaforcylinder

    Volume(V)isusedinstead,V=p(d/2)2*l.

    7)Centroid1isthemeanofallxcoordinatesfortheskeletonpixelsinagivenedge.

    8)Centroid2isthemeanofallycoordinatesfortheskeletonpixelsinagivenedge.

    UsingtheQueueTheQueue(Ctrl+Q)buttonstoresacopyofwhateverimageiscurrentlyintheModifiedImage

    window,andsendsathumbnailcopyoftheimagetoaseriesofsmallpanelsrunningalongthe

    righthandedgeoftheLEAFGUI.Uptotenimagescanbestoredinthisway.Atanypointthe

    usercanreturnoneoftheimagestotheModifiedImagewindowbyselectingtheposition

    (numberedtoptobottom)occupiedbythatimagefromtheQueuedropdownmenu.For

    example,selectingImage4fromthedropdownmenuplacesthefourthimagefromthetopof

    theQueueintheModifiedImagewindow.Inaddition,alloftheimagesintheQueuecanbe

    savedsimultaneouslytothefoldercontainingtheLEAFGUIsoftwarebyselectingtheSaveAllIn

    Queue(Ctrl+H)optionsfromthedropdownmenu.Moreover,byselectingClearQueue(Ctrl+P),

    theusercancleartheQueuetoallowformoreimagetobestored.

    ClearingCurrentImages(Ctrl+D)

    17

  • 8/7/2019 Leaf GUI User Manual

    18/28

    LEAFGUIUserManual Priceetal.

    ClearsallimagesfromtheGUIwindowandQueue:Dothisstepbeforestartingtoworkwitha

    newimage.Onclickingthisbuttonadialogboxwillopenaskingiftheuserreallywantstoclear

    alltheimages.Thisistopreventaccidentalclearingofallimages.

    Undo(Ctrl+U)Undoesthelaststep:Astheuserisworking,copiesofthelast20imagesthatwereprocessed

    arestored,andcanbereturnedtotheModifiedImagewindowbyclickingUndo.However,

    thereisnoredooptionmeaningthatonceausergoesbacktoapreviousimage,theimages

    thathadbeensubsequenttoitarenolongerstored.

    InterruptTheinterruptbuttonallowstheusertointerruptanyalgorithmthatistakingalongtime.Some

    ofthestatisticsalgorithms,particularlyVeinStats,cantakeawhileonalargeleaf.Thisfunction

    givestheusertheoptiontohaltanyprocessescurrentlyrunning.

    18

  • 8/7/2019 Leaf GUI User Manual

    19/28

    LEAFGUIUserManual Priceetal.

    DropDownMenusManyfunctionsareavailableindropdownmenusthatarenotontheLEAFGUImainwindow.

    Inaddition,mostofthefunctionsavailableonthemainwindowarealsolistedindropdown

    menus.Thisisprimarilysotheusercanseethehotkeysavailable(seealsoTable1onpage

    28).

    FileOpenImage(Ctrl+O)Opensastandardwindowinwhichtheusercanlocateandclickonthe

    imagetheywouldliketoopeninLEAFGUI.

    SaveModifiedImage(Ctrl+M)Opensupafigurewindowwithwhichtheusercansavethe

    ModifiedImageintheformatoftheirchoice.

    SaveOriginalImage(Ctrl+I)Opensupafigurewindowwithwhichtheusercansavethe

    OriginalImageintheformatoftheirchoice.

    QuitLEAFGUI(Ctrl+W)ClosestheentireLEAFGUIprogram,afteraskingifthatsreallywhat

    youwanttodo.

    ImageMeasureScale SeeSettingtheScalepage6.

    MeasureDistance(inpixels)placesamovable,resizablelineontheimagethatdisplaysits

    lengthinpixels.Thisfeaturecanbeusefulformeasuringleaffeaturessuchastotalleafwidthor

    length(followinguserconversionfrompixelstomm).

    Undo(Ctrl+U)SeeUndopage18.

    ClearImages(Ctrl+D)SeeClearingCurrentImagespage18.

    19

  • 8/7/2019 Leaf GUI User Manual

    20/28

    LEAFGUIUserManual Priceetal.

    OriginaltoModifiedsendstheimagethatiscurrentlyintheOriginalImagepaneltothe

    ModifiedImagepanel.

    ModifiedtoOriginalsendstheimagethatiscurrentlyintheModifiedImagepaneltothe

    OriginalImagepanel.

    CropwithRectangle SeeImageCroppingpage6.

    CropwithPolygonSeeImageCroppingpage6.

    CompositeFunctionsOriginalw/skeletonthiscreatesacompositeimageusingthebinaryimageintheModified

    Imagewindow.Theresultisarepresentationoftheleafveinnetworkwithblueveins,

    superimposedredSkeleton,andablackbackground.Thisallowstheusertoinvestigate

    whetherthealgorithmcorrectlyidentifiesnodesandedges(seealsoBinaryplusedges,nodes

    andtips).

    Binaryplusedge,nodesandtipsthiscreatesacompositeimageusingthebinaryimageinthe

    ModifiedImagewindow.Theresultisarepresentationoftheleafveinnetworkwithblack

    background,blueveins,andsuperimposedlightblueSkeleton,rednodes,andyellowtips.This

    allowstheusertoinvestigatewhetherthealgorithmiscorrectlyidentifyingnodes,edgesand

    tips(seealsoOriginalw/skeleton).

    Connected

    Nodes

    this

    algorithm

    creates

    a

    skeletonized

    image

    of

    the

    binary

    network

    overlain

    withnodesencircledinblueandrededgesshowingwhichnodesareconnected.Thisoption

    allowstheusertoassesstheextenttowhichthealgorithmsarecorrectlyidentifyingtheactual

    nodesandedges.

    20

  • 8/7/2019 Leaf GUI User Manual

    21/28

    LEAFGUIUserManual Priceetal.

    SuperimposePerimeterthissuperimposesaredcopyoftheperimeterofthebinaryveinimage

    thatisdisplayedintheModifiedImageWindowontopofagrayscaleversionoftheimagein

    theOriginalImageWindow.Thisstepallowstheusertoinvestigatehowwelltheresultsfrom

    previousthethresholdingandcleaningalgorithmsworked.

    CleanBinaryRemoveRegions (Ctrl+R)SeeRemoveRegionspage10.

    RemovePerimeter(Ctrl+P)SeeRemovePerimeterpage10.

    FillSingles(Ctrl+E)fillsanysingleblackpixelsthatareentirelysurroundedbywhitepixels

    (DemoVideo6).Thisisahelpful,andtypicallyanecessarystepincleaningtheimage.Dueto

    imagenoisethereareoftensingleblackpixelssurroundedbywhitepixelsthataredifficultto

    seeinboththeModifiedimagewindowandthecorrespondingzoomwindow.Fillingthepixels

    eliminatesthisproblemandimprovestheperformancesofsubsequentstatisticsalgorithms,

    particularlytheEdgeStatsandAreoleStatsalgorithms.Toremoveregionslargerthanasingle

    pixel,theRemoveRegionsoptioninthecomplementofthebinaryimagecouldbeused.

    FillHolesthisoptionfillsanyregionswithintheimagethatareentirelysurroundedbywhite

    pixels.ThisstepcouldbeusefulingeneratingaMask(seeabove).

    FillRegions(Ctrl+Y)SeeFillRegionspage11.

    RemoveSpurs(Ctrl+N)SeeRemoveSpurspage11.

    Clear

    Border

    (Ctrl+E)

    See

    Clear

    Border

    page

    12.

    RemoveLabeled(Ctrl+G)SeeRemoveLabeledpage11.

    ImageComplement(Ctrl+Q)SeeImageComplementpage12.

    21

  • 8/7/2019 Leaf GUI User Manual

    22/28

    LEAFGUIUserManual Priceetal.

    Thin(Ctrl+X)Removestheexteriormostpixelsfromcontiguousregions.Thismightbehelpfulif

    theuserthinkstheveinsonthebinaryimagearemuchthickerthantheactualveins.However,

    keepinmindthatforveinsthreepixelswideorless,thisstepwillthintheveintoasinglepixel,

    thusveinsthatarethreepixelswideandveinsthataretwopixelswidewillbecomeasingle

    pixelwide:usewithcaution.

    DiagonalFillthisoptioneliminateseightconnectedpixelsinthebackground(seeMatlab

    documentation).

    DilateImage performsimagedilationwitha3x3structuringelement.Formoreinformationon

    dilationseeMatlabdocumentation.

    ErodeImage performsimageerosionwitha3x3structuringelement.Formoreinformationon

    erosionseeMatlabdocumentation.

    CloseImageperformsamorphologicalcloseoperation(dilationfollowedbyerosion)witha

    3x3discasastructuringelement.FormoreinformationseeMatlabdocumentation.

    SkeletonizeIteratively(Ctrl+F)sameresultasSkeletonabove,butdoessoiteratively,i.e.pixels

    areremovedfromtheboundariesofthebinaryimageonelayeratatime.

    ZoomRefreshZoom(Ctrl+Z)usethisstepafterresizingormovingtheZoomWindowintheOriginal

    Image.

    This

    step

    will

    also

    update

    the

    red

    reference

    window

    in

    the

    Modified

    Image

    window

    whichsimplyallowstheusertoseeeasilytheregionontheModifiedImagethattheZoom

    WindowontheOriginalImagecorrespondsto.

    22

  • 8/7/2019 Leaf GUI User Manual

    23/28

    LEAFGUIUserManual Priceetal.

    ImageSegmentationLabelLeafVeinsseeLabelLeafVeinspage13.

    LabelAreolesseeLabelAreolespage13.

    BinarizeRGBseeBinarizeRGBpage13.

    DistanceTransformthisbuttonmeasuresthedistancefromeveryblackpixelintheimageto

    everywhitepixel,thenconvertsthosedistancestoaheatmapsotheusercanvisualizehowfar

    awayareoleinteriorsarefromveins,orhowfartheveininteriorsarefromareoles.Thedata

    correspondingtothisfigureisreturnedfromtheEdgeStatsalgorithm.

    StatisticsAreaStatsseeAreaStatspage14.

    AreoleStatsseeAreoleStatspage14.

    VeinStatsseeVeinStatspage16.

    ConnectivityMatrixthiscommandgeneratesamatrixshowingwhichNodesareconnectedto

    whichEdges.TodeterminetheConnectivityMatrix,the3x3neighborhoodaroundeachnodeis

    searchedtoseewhatedgesitisconnectedto.TheConnectivityMatrixisfirstrepresentedasan

    NxN (N=numberofnodes)matrixwhererowsandcolumnindicesrepresentthelistofnodes,

    andmatrixentriesrepresenttheedgesthatconnectnodes.Tosavespace,theconnectivity

    matrixisthencondensedtoanEx3(E=numberofedges)matrixshowingwhichlabelednodes

    (columns1and2)areconnectedbywhichlabelededges(column3).

    23

  • 8/7/2019 Leaf GUI User Manual

    24/28

    LEAFGUIUserManual Priceetal.

    QueueImage1Image10 thesefunctionssimplymoveacopyofwhateverimagehasbeenstoredin

    thecorrespondingQueueposition,numberedtoptobottom.Forexample,iftheuserhas

    previouslystoredacopyofabinaryleafveinimageinthesecondQueueposition,byclickingon

    Image2intheQueuedropdownmenuthatimagewillbemovedtotheModifiedImage

    window(seeDemoVideo5).

    SendtoQueueSeeUsingtheQueuepage17.SaveAllinQueueSeeUsingtheQueuepage17.ClearQueue SeeUsingtheQueuepage17.

    24

  • 8/7/2019 Leaf GUI User Manual

    25/28

    LEAFGUIUserManual Priceetal.

    CaveatsWhenandwhennottouseLEAFGUI

    1)LEAFGUIworksbestonimageswherethereisgoodcontrastbetweenveinsandimage

    background.Ifthegrayscaleintensityofthebackgroundistoosimilartotheveinsthemselves,

    thresholdingstepswillnotbeabletosegmenttheimageswell,andtherewillbesignificant

    noiseintheresultingbinaryimages.

    2)Ifimagesareveryhighresolution,theskeletonizationalgorithmsuponwhichtheVeinStats

    functionreliesmaycreatespuriousEdges,particularlyinthelargestveins.Useeitherthe

    Originalw/SkeletonortheBinarywithedges,nodesandtipsoptionsintheCompositedrop

    downmenutoinvestigatethis.ThereareseveralmethodsbuiltintotheLEAFGUItoreducethis

    phenomenonincludingusingFillRegions,RemoveSpurs,DiagonalFill,DilateImage,Erode

    Image,CloseImage,Bridge,ThinandFillandtheabilitytoperformmanyofthesefunctionson

    subsectionsofimageswiththeFullorZoomoption;howeverallofthesemethodsshouldbe

    usedwithcaution.

    3)Theresultsfromthesoftwareareheavilydependentonthequalityoftheinitialimages.

    Takingalittleextratimebeforehandtoimproveimagequalitywillgoalongwaytoward

    improvingthesoftwaresperformance.

    4)Someofthealgorithms,inparticularthestatisticsalgorithmscantakeasignificantamount

    oftimetocomplete.Theamountoftimeincreasesexponentiallywithleafsize.Wehave

    processedleaveswithover100kindividualnodes,butdoingsoonacomputerwitharelatively

    slowprocessorisnotagoodidea,andmayproduceanoutofmemoryerror.Wehopeto

    25

  • 8/7/2019 Leaf GUI User Manual

    26/28

    LEAFGUIUserManual Priceetal.

    developanonlineversionoftheGUIlinkedtoadedicatedserver,orevenperhapsa

    supercomputer,butuntilthattime,wesuggestrunningLEAFGUIonamorepowerfulmachine.

    5)AlmostallofthefunctionsinLEAFGUIareinterruptiblemeaningthatifanewfunctionis

    invokedtoosoon,thepreviousfunctionmaynothavefinished.Thustoavoidconfusingresults

    fromclickhappyusers,patienceisadvised.

    26

  • 8/7/2019 Leaf GUI User Manual

    27/28

    LEAFGUIUserManual Priceetal.

    ContactsDrChuckPrice

    PostdoctoralFellow,WeitzLab

    SchoolofBiology

    GeorgiaInstituteofTechnology

    Atlanta,GA,30332

    [email protected]

    ContactinformationasofAugust2010:

    AssistantProfessor

    SchoolofPlantBiology

    UniversityofWesternAustralia

    35StirlingHighway

    Crawley,Perth

    WesternAustralia6009

    DrJoshuaWeitz

    AssistantProfessor

    SchoolofBiology

    GeorgiaInstituteofTechnology

    Atlanta,GA,30332

    [email protected]

    DrOlgaSymonova

    PostdoctoralFellow,WeitzLab

    SchoolofBiology

    GeorgiaInstituteofTechnology

    Atlanta,GA,30332

    [email protected]

    DrYuriyMileyko

    DepartmentofMathematics

    DukeUniversity,Box90320

    Durham,NC277080320

    [email protected]

    27

  • 8/7/2019 Leaf GUI User Manual

    28/28

    LEAFGUIUserManual Priceetal.

    Function HotKeyOpenImage O

    SaveModifiedImage M

    SaveOriginalImage I

    QuitLeafGUI W

    Undo U

    ClearImages D

    RemoveRegions R

    RemovePerimeter P

    FillSingles E

    FillRegions Y

    RemoveSpurs S

    ClearBorder B

    RemoveLabeled L

    ImageComplement K

    Skeleton F

    RefreshZoom Z

    LabelLeafVeins V

    LabelAreoles A

    BinarizeRGB G

    SaveAllInQueue H

    ClearQueue N

    SendtoQueue Q

    Table1.HotkeysavailableintheLEAFGUI.Thesearealsonotedinthedropdownmenus.Whereverpossible,wehavechosentheHotKeystomakethemmnemonicasindicatedbythe

    grayshading.