29
Copyright notice Top Next DeVIDE is copyright (c) 2002-2008 Charl P. Botha, TU Delft All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: · Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. · Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. · Neither the name of the TU Delft nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITYAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright notice fileDevelopment of Improved endo-Prostheses for the upper EXtremity, or DIPEX, is the research programme where it all began. DSCAS1, DSCAS3 and finally DeVIDE

  • Upload
    hatram

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Copyrightnotice TopNext

DeVIDEiscopyright(c)2002-2008CharlP.Botha,TUDelft

Allrightsreserved.

Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,arepermittedprovidedthatthefollowingconditionsaremet:

·Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistofconditionsandthefollowingdisclaimer.

·Redistributionsinbinaryformmustreproducetheabovecopyrightnotice,thislistofconditionsandthefollowingdisclaimerinthedocumentationand/orothermaterialsprovidedwiththedistribution.

·NeitherthenameoftheTUDelftnorthenamesofitscontributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftwarewithoutspecificpriorwrittenpermission.

THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANYEXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALLTHECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

Sponsors PreviousTopNext

Thedevelopmentofthissoftwarewassupportedbythefollowinginstitutions:

TheDelftUniversityofTechnology(TUDelft),myfabulousemployerandpermanentresearchhome.WeDoReallyCoolStuff(tm).

TheVirtualLaboratoryfore-Science(VL-e)projecthaspartlyfundedrecentdevelopmentofthesoftware.

DevelopmentofImprovedendo-ProsthesesfortheupperEXtremity,orDIPEX,istheresearchprogrammewhereitallbegan.DSCAS1,DSCAS3andfinallyDeVIDE.

Introduction PreviousTopNext

ThisistheusermanualandhelpfilefortheDeVIDEsoftwarepackage.DeVIDEistheopensourceDelftVisualisationandImageprocessingDevelopmentEnvironment.

Thesoftwarewasdesignedfortherapidprototypingandtestingofvisualisationandimageprocessingtechniques.Allfunctionalityispackagedintheformofmodules.Oneofthewaysinwhichthesemodulescanbeused,istomakeuseoftheDeVIDEGraphEditor,whereglyphs,representingmodules,canbeconnecteduptoformfunctionaldata-processingnetworks.Akeyfeatureisthatanycodeobjectcanbeaccessedandinteractedwithinreal-time.ThisenablesbothmodulewritersandusersoftheGraphEditortoexperimentwithforexampleallparametersandeventhelogicbehindarunningpieceoffunctionality.

DeVIDEisavailableasopensourceunderthetermsofthenewBSDlicense.BinariesareusuallymadeavailablefortheWindowsandLinuxplatforms.

Themainwebsiteofthissoftwareisathttp://visualisation.tudelft.nl/Projects/DeVIDE.Pleasegothereforlinkstomoredocumentation,theGoogleCodeprojectsite,themailinglistandthenewsblog.

Thismanualisinaperpetualstateofbeingunderheavyconstruction.TheGraphEditorandUsefulPatternssectionsareespeciallyusefulandshouldbereadbeforeyoustartworkingwiththesoftware.

Introduction PreviousTopNext

TheDeVIDEGraphEditorisavisualprogramminginterfacewhereglyphsrepresentingtheunderlyingDeVIDEmodulescanbeconnectedtogethertoformnewprograms.

It'sthemostflexiblewayofworkingwithDeVIDE,shortofdirectlyinterfacingwiththeunderlyingcode.

Thischapterwillgiveabriefoverviewofgrapheditorusage.

Asmallsamplenetwork PreviousTopNext

TheGraphEditorisintroducedbyputtingtogetherasimplenetworkforrenderingthe3D0-surfaceofaSuperQuadric.It'sfarsimplerthanitsounds.

ConstructingthenetworkStartbybuildingthenetworkshowninthefigurebelow.Firstselectthe"Sources''categoryonthetopleftoftheGraphEditor.Draganddropthe"superQuadric''modulefromthemoduleslistonthebottomlefttothecanvas.Youshouldseethe"superQuadric''glyphbeingcreated.

Nowdothesameforthe"slice3dVWR''moduleinthe"Viewers''category.NotethatyoucanselectmultiplecategoriesbyholdingtheShiftkeyandclickingacategory(thiswillselectallcategoriesbetweenthepreviousselectedcategory

andyourcurrentclick)orholdingthecontrolkeyandclicking(thiswillselectthecurrentlyclickedmodulealongwithanypreviouslyselectedmodules).Themodulelistwillcontainallmodulesinallselectedcategories.Themodulesarealwaysalphabeticallysorted.

Connectthesecondoutputofthe"superQuadric''glyphtoanyinputofthe"slice3dVWR''glyphbydraggingthemouse,withtheleftbuttondepressed,fromtheoutputporttotheinputport.NotethathoveringthemousepointeroveranyportshowsmoreinformationaboutthatportinthestatusbaroftheGraphEditor.

AdmiringyourresultsNowpressF5orselectNetwork|Executefromthemainmenubartoexecutethenetwork.

Right-clickontheslice3dVWRmoduleandselect"View-Configure''toseethe3Dsurfacerepresentingthe0-surfaceofthegeneratedSuperQuadric.Notethatthisishowoneactivatesthegraphicalinterfaceofanyglyphonthecanvas.Youcanrotateyourviewpointaroundthegenerated3Dobjectbydraggingwithyourleftmousebutton.Draggingwiththerightbuttonwillzoom.Draggingwiththemiddlebuttonwillpantheviewpoint.

Thenetworkcanbesavedbyselecting"Save''fromthe"File''menu.ThedefaultextensionforaDeVIDEnetworkis.dvn.

WarpingtheSuperQuadricTheslice3dVWRisaveryspecialDeVIDEmodule.Becauseofthis,itsView/Configinterfaceisnon-standard.Rightclickonthe"superQuadric''glyphandselect"View-Config''toseeamorestandarduserinterface(youcanalsojustdouble-clickontheglyph,manyusersfindthistobequicker).Thisinterfaceisshowninthefigurebelow:

MostmoduleView/Configwindowshavethesetofbuttonsatthebottom.Ifyoumakeanychangestoanyofthemoduleparameters,youhavetoclickonthe"Apply''button(inwhichcasetheparameterswillbetransferredtotheunderlyinglogic)orthe"Execute''button,(inwhichcasethenewparameterswillbetransferredtotheunderlyinglogicandthemodulewillbeaskedtore-performitsexecutionwiththemodifiedparameters).Clickingonthe"Cancel''buttonwillundoanychangesyou'vemadewithoutapplyingandclosethewindow.Clickingon"OK"willapplyallchangesandclosethewindow.

Changethe"PhiRoundness''parameterto3.0andclickon"Execute''orsimplypressF5orAlt-X.Pressingoneofthesekey-combinationsiseffectivelythesameasclickingon"Execute''.Seetheresultsofyourchangesintheslice3dVWRwindow.

Afewimportanttips PreviousTopNext

Beforewestart,afewproductivity-enhancingsecretsoftheGraphEditorarerevealedhere.

PlacingmodulesYoucanplacemodulesonthecanvasinmorethanoneway.·Draganddropthemodulenamefromthemodulelistonthebottom-left

ontothecanvas.Youcannarrowdownthelistofmodulesbyselectingoneormorecategories.The"ALL''categoryincludesallmodulesavailable.

·Doubleclickingonamodulenamewillplacethatmoduleonthecanvas.·Typinginthemodulesearchboxontheupperleftandthenpressingthe

ENTER-keywillplacethefirstautomaticallyselectedmoduleinthesearchresultsonthecanvas.Seethenextsectionformoredetailsonthis.

PlacingmodulesquicklyAsmentionedabove,modulescanbeplacedbytypinginsearchphrasesinthemodulesearchboxintheupperleftofthemainDeVIDEwindow.Onlymodulesinthecurrentlyselectedcategorieswillbefound,thereforeitisrecommendedthatyouselectthe"ALL''categorywhenmakinguseofthisfunctionality.

YoucanquicklygotothesearchboxbyusingtheCtrl-Fhotkeys.Typinganysearchtermswillshowsearchresultsinreal-timeinthemodulelistbox.Modulesaresearchedbyexaminingtheirnames,keywordsandthemodule-specificdocumentation.Atalltimes,amodulewillbeautomaticallyselectedinthesearchresults.Youcanchangetheselectionbyusingtheupanddowncursors.PressingtheENTERkeyatanytimewillplacethatmoduleonthecanvas.

Gettingmodule-specifichelpManymoduleshavemodule-specifichelp-textbuiltin.Toseethishelp,justselectthismodulefromthemodulelistatthebottomleftofthemainDeVIDEwindow.Themodulehelpwillappearinthemoduledocumentationwindowbelowthemodulelist.

Alsorememberthatselected(special)modulesaredocumentedinthechapterSpecialModules.

Readingdata,quicklyDragginganddroppingcertaindata-filesontheGraphEditorcanvaswillcausethesystemtoautomaticallycreateandconfiguretheapplicablemodule.Forexample:selecting,dragginganddroppingacollectionofDICOM.dcmfilesonthecanvaswillresultinadicomRDRglyphtobecreatedandpre-configuredwiththelistoffilesthathasbeendropped.

Followingthesametheme,dragginganddroppingafilename(oracollectionoffilenames)onamodulethathasafilenameattribute(suchasmostfilereaders)willsetthatfiletobereadonthenextnetworkexecute.Thisisusefulwhenyouhaveasinglenetworkthatyouwanttoapplyonanumberofdifferentdatasets:justdragthenewfilenameontothereaderinquestionandexecute!

Re-usingnetworks,quicklyDragginganddroppinga.dvn(DeVIDENetwork)fileonthecanvaswillinstantlyloadthenetworkandbuilditatthemouseposition.Thiswillnotdestroyanyofyourcurrentnetworksonthecanvas.

Introduction PreviousTopNext

ThischapterhasmoredocumentationonsomeofthemorecomplexmodulesinDeVIDE.Rememberthatallmoduleshavemodule-specificdocumentation,availablebyrightclickingonthemoduleglyphandselecting"HelponModule''orbyqueryingthedoc-stringofthemainmoduleclass.

slice3dVWR PreviousTopNext

IntroductionThisisprobablythemoduleyou'llusemostoften.It'salsothefirstthingyoushouldtrywheneveryouhaveanydatayou'dliketovisualise.Simplyconnecttheoutputofanydata-generatingorfilteringmoduletoanyinputoftheslice3dVWRandexecutethenetwork.Theslice3dVWRpicksasuitabledefaultvisualisationbasedontheinputdatayousupply.

SlicesWhenavolumehasbeenconnectedtoaninputoftheslice3dVWR,thevolumecanbeexaminedby"slicing''throughit.Bydefault,anaxialsliceiscreatedautomatically,butanynumberofadditionalslicescanbeactivated.

OverlaymodesTheslice3dVWRhasseveraloverlaymodes.Thesemodesmakeitpossibletovisualisethecorrespondencebetweenmultipleinputs,fore.g.originalCTdataandasegmentation.Ifasecondvolumeinputisconnected,theslice3dVWRchecksifthedimensionsofthealreadyconnectedvolume.Ifthisisthecase,theconnectionisallowedandthesecondvolumeisoverlayed(superimposed)onthefirst.

Thereareseveralwaystoperformthisoverlay.Thissettingisuser-configurableanditsuserinterfacecanbefoundonthe"Main''taboftheslice3dVWR"Controls''window,inthe"Slices''section.TheuserinterfaceconsistsofanOverlayModechoiceboxandanAlphaslider.Thealphasliderdeterminesthealphaparameterusedforthefusion-basedoverlaymodes.·GreenFusion:Theoverlayiscompositedwiththeuser-definedalpha

parameter.Thevalue(i.e.brightness)isdirectlyrelatedtotheimageintensityoftheoverlay,soweseeshadesofgreen(reflectingtheoverlayintensity)alphablendedwiththeprimaryinput.

·RedFusion:Sameasabove,exceptwithshadesofred.·BlueFusion:Sameasabove,exceptwithshadesofblue.·HueFusion:Thevalueiskeptconstant,butthehueisdirectlyrelatedtothe

overlayimageintensity.Theoverlayisalphablendedwiththeuser-suppliedalphaparameter.

·Hue/ValueFusion:Hueandbrightnessaredirectlyrelatedtotheoverlay

imageintensity.Theoverlayisalpha-blendedwiththeuser-suppliedalphaparameter.

·GreenOpacityRange:Theopacityoftheoverlayisdirectlyrelatedtoitsimageintensity.Thehueisconstantgreenandthebrightnessisconstantunity.

·BlueOpacityRange:Thesameasabove,exceptthehueisconstantred.·BlueOpacityRange:Thesameasabove,exceptthehueisconstantblue.·HueOpacityRange:Thehueandtheopacityoftheoverlayaredirectly

relatedtotheoverlayimageintensity.

Adjustingthealphasliderwhilstoneofthe"fusion''overlaymodesisactivewillresultinreal-timechanges.Theideaistoadjustitupanddownitscompleterangeinordertogetabetterideaoftheamountoftheimagecorrespondence.

CodeRunner PreviousTopNext

IntroductionWiththeCodeRunner,arbitrarysnippetsofPythoncode,usinganyofthelibrariesshippingwithDeVIDE,canbeinsertedintoafunctionalnetwork.Thisisaprettypowerfulconceptthatenables*very*rapidprototypingofnewideasorquickimplementationofprocessingsolutions.

AnexampleWe'llillustratewithanexample.Firstbuildupthissmallnetwork:

DoubleclickontheCodeRunner,causingitsViewtoappear.TheView'stop-halfconsistsofaneditorcomponentwiththreetabs:Scratch,SetupandExecute.PastetheblockofcodebelowintotheSetuptab:

#thisblockgoesintothe"Setup"taboftheCodeRunnerimportvtkfe=vtk.vtkFeatureEdges()tf=vtk.vtkTubeFilter()tf.SetRadius(0.01)tf.SetNumberOfSides(16)tf.SetInputConnection(fe.GetOutputPort())

...andthefollowingblockintothe"Execute"tab:

#thisblockgoesintothe"Execute"taboftheCodeRunnerfe.SetInput(obj.inputs[0])tf.Update()

obj.outputs[0]=tf.GetOutput()

Nowclickonthe"Execute"buttonatthebottomoftheCodeRunnerView.Inyourslice3dVWR,youshouldseesomethinglookingmoreorlesslikethefigurebelow:

Prettyslickeh?

WorkingwithScratch,SetupandExecutetabsUsingCodeRunnermodules,youcaninsertarbitrarycodesegmentsintoyourDeVIDEnetworks.The"Scratch"tabisforexperimentation,the"Setup"tabcoderunsONCEforanychangesthatyoumake(youshouldusethisforbuildingpipelinesforexample),andthe"Execute"tabrunseverytimethenetworkisexecutedandtheCodeRunner'sinputshavechangedoranyoftheCodeRunnertabshavebeenmodified.

Whilsteditinganyofthetabs,pressControl-Entertoexecutejustthattabatthatmoment.Clickingonthe"Execute"buttonatthebottomoftheViewrequeststhewholenetworktoberun.LiberaluseofControl-EnterwhilsteditingwillmakesurethatallPythonobjectsthatyouhavecreatedwillbeinstantiated.Besidesthefactthatcode-completionandinlinedocumentationcanthendoitsthing,you

caneasilyexperimentatrun-time.

DICOMBrowser PreviousTopNext

IntroductionWiththeDeVIDEDICOMBrowser,releasedwith8.5,youcaneasilyexplorecollectionsofDICOMdata.ItisintendedtobeusedasavisualinterfacewithwhichDICOMseriescanbeeasilyselectedandloaded,usingthecompanionDICOMReadermodule,intoDeVIDEforfurtherprocessing.

BelowascreenshotoftheDICOMBrowserGUIisshown:

Alsoseeourintroductoryscreencastonyoutube:http://www.youtube.com/watch?v=iLfu6JXkWP4

StartingtheexplorationEnteranynumberofdirectoriesandorfilenamesintothe"FilesandDirectoriestoScan"textinputbox,separatedbysemicolons.Youcaneithertypetheseinyourself,cutandpastethemfromsomeotherapplication,ormakeuseofthe"AddDirs"and"AddFiles"dialogbuttons.

Afterhavingenteredallpathsthatyouwishtoscan,clickonthe"Scan"button.Post8.5versionsoftheDICOMBrowserwillshowaprogressbarwhilstscanning.

Whenscanninghasbeencompleted,allotherpanelsintheinterfacewillbefilledoutwithinformation.

ExploringyourdataDICOMdataisdividedupintostudies,whereeachstudyisassociatedwithapatient,anumberofseriesperstudy,andanumberofimagesperseries.TheDICOMBrowserallowsyoutoselectanyoftheseelementsbyclickingintherelevantpanel.Onceyou'veselectedaspecificseries,whichcanusuallybeseenasasingledatavolume,youcanbrowsethroughtheimagesinthatseriesbyclickingontherelevantfileinthe"ImageFiles"panel,orbymakinguseoftheCtrl-NCtrl-Photkeysfornextimageandpreviousimage,orbyclickingontheimageandthenusingthemousewheeltomove,1imageatatime,throughtheseries.Control-Mousewheelwillskip10imagesatatimeandallowsrapidscrollingthroughaseries.

LoadingdataforfurtherprocessingOnceyouhaveidentifiedaninterestingseries,youcancreateaDICOMReadermoduleontheDeVIDEcanvas,andthendragdirectlyfromtheseriesitemorfromaselectionoffilenamesontotheDICOMReader.TheDICOMReaderwillnowbeconfiguredwiththecorrectfilenamesandcanbeexecutedtoloadthedataforfurtherprocessingbyDeVIDEnetworks.

Youcanalsodragaseriesorselectionoffilesontomostfilemanagerwindows(exploreronWindows,nautilusonGnome)tocopythosefilesintothedestinationdirectory.

ShortcutsCtrl-N,mousewheeldownonimage Nextimageinseries

Ctrl-P,mousewheeluponimage PreviousimageinseriesCtrl-mousewheelonimage Skip10images

Ctrl-0,Ctrl-1 Changeviewlayouts(default,maximage)

Introduction PreviousTopNext

Thischaptercontainsaselectionofhowtos,i.e.veryshortdescriptionsofhowtoperformsomeactionwiththeDeVIDEsoftware.

LoadingandviewingDICOMdata PreviousTopNext

TheeasiestwaytoloadaDICOMdatasetistoselecttherelevantDICOMfiles(oftenwitha.dcmextension)inyourfilebrowser(e.g.ExplorerinWindowsandKonquerorinKDE)andtodraganddroptheselectedfilesontheGraphEditorCanvas.ADICOMReadermodulewillbeautomaticallycreatedwiththeselectedfilenamesadded.

Alternatively,youcancreateaDICOMReadermoduleinthenormalway,i.e.bydragginganddroppingthemodulefromtheModulePaletteontothecanvas.DoubleclickonthemoduletoopenitsView/Configwindow.ClickontheAddFilesbuttontoaddanynumberofDICOMfilenames.RemembertoclickonApplyafterhavingaddedtherelevantfilenames.AlternativelydraganddropanumberofDICOMfilesontothelistbox,ordirectlyontotheglyphonthecanvas.Thisisoftenfareasier.

Tostartvisualisingthevolumethatyouhavejustloaded,createaslice3dVWRmoduleandthenconnecttheoutputoftheDICOMReadermoduletoanyinputoftheslice3dVWRmodule.Themoduleinterfacewillautomaticallyappearwiththedefaultaxialslice.Toreadmoreaboutinteractingwiththisslice,seetheslicessectionoftheslice3dVWRdocumentation.

ForafarmorepleasantDICOMbrowsingexperience,trytheDICOMBrowser.Ascreencastdemonstratingthisfunctionalityisavailableathttp://www.youtube.com/watch?v=iLfu6JXkWP4.

Smoothingdata PreviousTopNext

ThereareanumberoffiltersinDeVIDEthatcanbeusedforsmoothingvolumedata.

Filters.imageGaussianSmoothperformsastraight-forwardGaussiansmoothing(alsoknownas"blurring''insomeimageprocessingpackages).Thestandarddeviation(inpixels)canbesetforallthreedimensions.Atruncation,orcut-off,canalsobesetforallthreedimensions.Takeintoaccounttheresolutionofyourimagewhenselectingtheseparameters.

curvatureFlowDenoising,curvatureAnisotropicDiffusionandgradientAnisotropicDiffusion,allinthe"Insight''modulecategory,aremoreadvancedsmoothingalgorithmsthatattempttosmoothhomogeneousregionswhilstretainingedgeinformation.Theseareallcompute-intensiveITK-basedfilters.Pleasereadthetooltipsavailableintheconfigurationwindows:i.e.doubleclickonthemoduleandthenletyourmousehoveroveranyoftheinputboxestogetmoreinformationaboutthevariablerequiredforthatinputbox.Thedefaultsarenaturallygoodvaluestostartwith.

WhenyouusethesewithVTKdata,forexampletheoutputofavtiRDR,youhavetouseaVTKtoITKF3conversionmodule.Tovisualisationtheoutput,youneedtoconvertbacktoVTKdatabymakinguseofanITKF3toVTKmodule.However,ifyou'replanningtousetheoutputinanITKfilter,forexamplethedemonsRegistration,youdon'tneedanITKF3toVTKconversionmoduleattheoutput.Thefigurebelowshowsanexampleofthis.

Performinglandmarkregistrationontwovolumes PreviousTopNext

IntheMRIretrobulbarfatmobilitystudy,multipleMRIdatasetsaremadeofasubjectduringdifferentdirectionsofgaze.Althoughgreatcareistakentopreventrigidheadmotion,thisdoesstilloccur.Sobeforethedeformationofthefatiscalculated,rigidheadmotionhastobeeliminatedbymeansofalandmark-basedrigidregistration.

Oneofthedirectionsofgazeischosenasthecentralorreferencedirection:allotherdatasetshavetoberegisteredontothisdataset.Inthisway,alldatasetswillshareacommonframeofreference.

Inthenextsubsections,wewillexplainhowtoperformonesuchregistration.Thisobviouslyhastobeperformedforalldatasetsthatyouhavetoregisterontothereferencedataset.ThefigurebelowshowsanexampleDeVIDEnetworkforperformingthislandmark-basedrigidregistration.Refertoitduringthefollowingexplanation.

SelectsourceandtargetpointsSelectatleast3,preferablymorerigidlandmarksthatcanbeaccuratelylocalisedinalldatasets.

Selectthesepointsinthereferencedatasetsbyusingthemousecursorina3Dslice3dVWR.Youhavetonamethesepoints(intheslicedVWRcontrolpanel,

enterthenameintothe"name''inputboxbeforeclickingonthe"Storethispoint''button.Thenamesofthesepointshavetostartwith"Target'',forexample"TargetZygoma1''.

Saveyournetworkregularly!

Nowloadinthefirstdatasetthatyouwanttoregisterontothereferencedataset.Selectandstoreallcorrespondingpointsinthisdataset.Useaseparateslice3dVWR.Thenamesofthesepointsallhavetostartwith"Source'',forexample"SourceZygoma1''.

Itisveryimportantthatyouselectthesepointsinthesameorderasthetargetpoints.

DerivethetransformInstantiatea"landmarkTransform''modulefromtheFilterscategory.Readitshelpbyright-clickingonthemoduleandselecting"HelponModule''.

Brieflyconnectanddisconnectthefirstoutputofthereferencedataset"slice3dVWR''toanyinputofthesecond"slice3dVWR''.Thiswillcopythe"Target''pointstothesecond"slice3dVWR''.

Nowconnectthefirstoutputofthesecond"slice3dVWR''totheinputofthe"landmarkTransform''module.Thismodulewillnowhaveaccesstothesourceandtargetpointsofthetwodatasetsthatyouaretryingtoregister.Asmentionedearlier,theorderofthesourcepointsshouldbeidenticaltothatofthetargetpoints.

TransformthedatasetConnecttheoutputofthe"landmarkTransform''tothesecondinputofa"transformVolumeData''module(category"Filters'').Connectthedatasetthatyouareregisteringontothereferencedatasettothefirstinputofthe"transformVolumeData''module.Theoutputofthismodulewillbethetransformedvolumedataset.Youcanaddittooneofthereferencedataset'sslice3dVWR'sinputsforanoverlay.Selectthe"PrimaryLUTfusion''overlaymodeintheslice3dVWRcontrolpanel.TheAlpha-parametercanbeadjustedto"fade''fromthereferencedatasettotheregistereddatasetandback.

Don'tforgettosaveyourtransformeddataset:Connecttheoutputofthe"transformVolume''moduletotheinputofa"vtiWRT''moduleforexample.Doubleclickonthe"vtkWRT''moduleandthenclickonthebrowsebuttontoselectafilename.Forallwritermodules,youHAVEtoclickonthe"Execute''buttonforittosavethefile.

Determiningopticalflowbetweentwovolumes PreviousTopNext

Inordertodeterminetheopticalflowbetweentworigidlyregistereddatasets,wemakeuseofthedemonsRegistrationnon-rigidregistrationmodule.Dothisaftertherpgidlandmark-basedpre-registrationandafterhavingextractedacommonsub-volumefromalldatasets.

ThisisanITKmodule,soyouhavetousetheITK-enabledversionofDeVIDE.Foreachpairofsuccessivevolumes,determinetheopticalflowbymakinguseofanetworkliketheoneshowninthefigurebelow:

Texttobecompleted...

Flowvisualisationwithglyphsonlyonslice3dVWRslices PreviousTopNext

Ifavectordatasetisavailable,suchastheonegeneratedbytheopticalflowproceduredescribedabove,thedeformationvectorfieldcanbevisualisedbymakinguseoftheFilters|glyphsmodule.However,thismodulevisualisesthecompletevectorfield.

Onecanalsovisualiseonlythevectorsonthecurrentslicesintheslice3dVWR.Todothis,buildanetworkasshownbelow:

Theslice3dVWRoutputsapolydatarepresentingthegeometryofallcurrentplanes.Inthiscase,weuseitasaprobeinputsothatwecanvisualisearrowglyphslocatedontheplane.

Rememberthattheopacityofslicescanbeadjusted(Slicesmenu:"SetOpacity'')sothatvisualisingabackgroundslicealongwiththedeformationvectorsonitiseasier.

Probingandwarping(interactiveadvection) PreviousTopNext

Thefigurebelowshowshowtoperforminteractiveprobingandwarping(advection)withDeVIDE:

ThevolumedatahasbeenloadedwithvtkRDRdvm11andservesascontextintheslice3dVWR.Inthiscase,weareusingtwovectorfields,loadedwithrespectivelymetaImageRDRdvm7anddvm11fyi11.Pointsthathavebeenselectedandstoredwiththeslice3dVWR(thesecanbechangedatanytime,thenetworkupdatesinteractively)arechangedintosphericalshellsofpointsbythepointsToSpheresmoduledvm6ldz6.Theoutputofthismodulecanbeconnectedtotheslice3dVWRtoviewtheinitialsphere.

ThefirstprobeFilterdvm7fxg7mapsandinterpolatesthevectorsfromthefirstvectorfieldontothepointsofthesphericalcloud.ConnecttheoutputoftheprobeFiltertothewarpPointsmodule.AfterconnectingthewarpPointsinput,makesureto"Execute''and"Apply''thewarpPointsmoduleonce.Thecorrect"Vectorsselection''canthenbemadefromitsView/Configwindow."Default

ActiveVectors''isveryoftenNOTwhatyouwant.Experimentwiththis.(ThijsenRonald,injulliegevalmoetdit"ImageFile''zijn!).Afterhavingmadethisselection,"Apply''or"Execute''themoduleagain.Nowyoucanconnectitsoutputtotheslice3dVWR.Thepointsareadvectedbythevectorsthatyouhaveassociatedtothem.

Thisoutputisalsousedinthenextadvectionstep,usingthenextvectorfield.Onceagain,makesuretoselectthecorrectvectorsinthewarpPointsmoduleView/Configwindow.YoucouldalsosimplycopyandpastethefirstprobeFilterandwarpPointsmodule(AFTERyou'veperformedthevectorselectionstep),inwhichcasetheselectionwillalreadybecorrect.

Addasmanyofthesestepsasarenecessarytocompletethefulladvectionwithallyouravailablevectorfields.Ateachstep,checkthatyoursphereisbeingcorrectlyadvectedbeforeyoucontinue.

Introduction PreviousTop

ThischapterwillexplainthevariouswaysinwhichyoucanextendDeVIDE'sfunctionality.ThismostlyhappensviathecreationofnewDeVIDEmodules.Therearevarioustypesofmodulesthatonecancreate,thischapterdocumentsmostof'em.

OtherpossibilitiesforextendingDeVIDEincludewritingSnippets(akindofpoorman'splugins)orsimplymakinguseoftheCodeRunnermodule.Thelatterisrecommendedifyouwanttotestyourideaasquicklyaspossibleandcan'tbebotheredwithreadingmanuals.Makinganewmodule,althoughtakingslightlymoretime,hasitsadvantages,suchasmoreflexibility,easierdistribution,andcreatingDeVIDEMiniApps!