Steve Pieper, PhD Raul San Jose, PhD Alex Yarmarkovich, PhD

Slides:



Advertisements
Similar presentations
NA-MIC National Alliance for Medical Image Computing ITK Workshop October 5-8, 2005 Software Design.
Advertisements

National Alliance for Medical Image Computing Slicer3 plugins: Going Further Common architecture for interactive and batch processing.
National Alliance for Medical Image Computing Slicer3 plugins Common architecture for interactive and batch processing.
Programming into Slicer3. Sonia Pujol, Ph.D., Harvard Medical School National Alliance for Medical Image Computing ©2010,ARR
NA-MIC National Alliance for Medical Image Computing National Alliance for Medical Image Computing: NAMIC Ron Kikinis, M.D.
Tk Widgets This material is best on several sources –Slides by Dr. Ernest J. Friedman-Hill –various Tcl/Tk books.
National Alliance for Medical Image Computing Slicer3 plugins Common architecture for interactive and batch processing.
Yingcai Xiao Chapter 4 The Visualization Pipeline.
NA-MIC National Alliance for Medical Image Computing Slicer and ITK generic image reader module Alex Yarmarkovich.
NA-MIC National Alliance for Medical Image Computing 3D Slicer Interactive Modules Steve Pieper, PhD.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D.
NA-MIC National Alliance for Medical Image Computing Slicer Custom Modules Steve Pieper, PhD.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering End-user Platform Steve Pieper Isomics, Inc.
Getting Started with ITK in Python Language
NA-MIC National Alliance for Medical Image Computing NAMIC-Kit Update Will Schroeder Jim Miller Bill Lorensen.
NA-MIC National Alliance for Medical Image Computing Why NITRC Matters to NA-MIC Steve Pieper, PhD.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Highlights, Aims and Architecture Will Schroeder Kitware.
1 Java Console I/O Introduction. 2 Java I/O You may have noticed that all the I/O that we have done has been output The reasons –Java I/O is based on.
Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame.
NCBC for NAMIC January Rationale Computational Anatomy specific analysis and statistics capability Create the following for NCBC – itk based statistical.
Programming into Slicer3. Sonia Pujol, Ph.D., Harvard Medical School -1- National Alliance for Medical Image Computing Programming into Slicer3 Sonia Pujol,
Java is an object oriented programming language In this model of programming all entities are objects that have methods and fields Methods perform tasks.
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
SimITK and SimVTK: ITK and VTK in Simulink DG Gobbi, P Mousavi, KM Li, J Xiang, A Campigotto, A LaPointe, G Fichtinger, P Abolmaesumi Medical Image Analysis.
NA-MIC National Alliance for Medical Image Computing Sebastien BARRE, Ph.D. / NA-MIC Programmers’ Week 2005.
NA-MIC National Alliance for Medical Image Computing NAMIC Software Development Workshop January 24-25, 2005 MIT Computer Science and.
NA-MIC National Alliance for Medical Image Computing National Alliance for Medical Image Computing: NAMIC Ron Kikinis, M.D.
PERL TK. 4.Use an IDE 3. Use the documentation! 2. Experiment. 1.Learn the basics.
NA-MIC National Alliance for Medical Image Computing Slicer and ITK Raul San Jose.
NA-MIC National Alliance for Medical Image Computing Slicer / ITK / VTK Development Tools Steve Pieper, PhD.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Programming into Slicer3. Sonia Pujol, Ph.D., Harvard Medical School National Alliance for Medical Image Computing ©
EMSegmentation in Slicer 3 B. Davis, S. Barre, Y. Yuan, W. Schroeder, P. Golland, K. Pohl.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
NA-MIC National Alliance for Medical Image Computing Slicer / ITK / VTK Development Tools Steve Pieper, PhD.
Top Secret CIBC Sneak Preview of Next Generation SCIRun Features and Directions.
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective.
NA-MIC National Alliance for Medical Image Computing Slicer 2.x Architecture Steve Pieper, PhD.
Arrays Chapter 7. MIS Object Oriented Systems Arrays UTD, SOM 2 Objectives Nature and purpose of an array Using arrays in Java programs Methods.
NA-MIC National Alliance for Medical Image Computing Slicer3 Update
NA-MIC National Alliance for Medical Image Computing Slicer Architecture Steve Pieper, PhD.
Creating Java Applications (Software Development Life Cycle) 1. specify the problem requirements - clarify 2. analyze the problem - Input? Processes? Output.
National Alliance for Medical Image Computing Slicer3 Plugins Common architecture for interactive and batch processing.
Innovation Intelligence ® Feb Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. GUI design Controls Toplevel.
Methods Matthew Harrison. Overview ● There are five main aspects of methods... ● 1) Modifiers – public, private ● 2) Method Name ● 3) Parameters ● 4)
Arrays Chapter 7.
ITK Video ITK Extensions for Video Processing
Introduction to Object-oriented Programming
C++ Lesson 1.
Topics Graphical User Interfaces Using the tkinter Module
From Scalars to Tensors: How to add new volume types?
Slicer and ITK generic image reader module
Session 2 What you already know about Java Reading and using an API
Core 2 Progress Day 1 Salt Lake City
DLPFC Semi-automatic Segmentor: With minimal user interaction, this rule-based algorithm will segment the DLPFC from an input volume. This is a Slicer.
Slicer3 Architecture.
CS/ENGRD 2110 Spring 2018 Lecture 5: Local vars; Inside-out rule; constructors
CS/ENGRD 2110 Spring 2017 Lecture 5: Local vars; Inside-out rule; constructors
Generic image diffusion system
Stack Memory 2 (also called Call Stack)
ITK-Overview Insight Software Consortium.
NAMIC Software Development Workshop
CS/ENGRD 2110 Fall 2017 Lecture 5: Local vars; Inside-out rule; constructors
CS/ENGRD 2110 Spring 2016 Lecture 5: Local vars; Inside-out rule; constructors
ITK Architecture Kitware Inc..
Topics Graphical User Interfaces Using the tkinter Module
Overview Before You Start Structure of a Module Ports and Datatypes
Slicer Timeline GUI Thread Processing Thread
Presentation transcript:

Steve Pieper, PhD Raul San Jose, PhD Alex Yarmarkovich, PhD Slicer and ITK Steve Pieper, PhD Raul San Jose, PhD Alex Yarmarkovich, PhD

Overview Embedding ITK Filtering Example Generic Reader Example vtkITK framework Filtering Example Generic Reader Example

How to use ITK? “Conventional Way”: Develop your own application My application Rendering Library GUI My Algorithm My classes ITK pipeline

How to use ITK? “Embedding”: Develop inside your platform (Slicer way) My platform GUI Module Rendering Module (vtk) ITK Pipeline Core Library (vtk) Library wrappers ITK

Slicer and ITK Data Flow: VTK – ITK – VTK VTK ITK VTK vtkImageExport itk::VTKImageImport itk::VTKImageExport vtkImageImport

vtkITK: Overview vtkITKMyFilter itk::MyFilter VTK ITK vtkImageExport itk::VTKImageImport itk::VTKImageExport vtkImageImport itk::MyFilter vtkITKMyFilter

vtkITK: Base classes vtkImageExport vtkImageImport vtkITKImageToImageFilter2DFF vtkImageToImageFilter vtkITKImageToImageFilterUSUS vtkITKImageToImageFilterF2F2 vtkITKImageToImageFilter vtkITKMyFilter vtkITKImageToImageFilterF3F3 vtkImageExport vtkImageImport vtkITKImageToImageFilterFF itk::VTKImageExport<itk::Image<float>,3>> itk::VTKImageImport<itk::Image<float>,3>>

vtkITK: Example Case: Perform a edge-preserving filtering as a preprocessing before segmentation. Algorithm: Anisotropic diffusion process. Code: itk::GradientAnisotropicDiffusionImageFilter. http://www.itk.org/Doxygen16/html/classitk_1_1GradientAnisotropicDiffusionImageFilter.html

vtkITK: Wrapping #include "vtkITKImageToImageFilterFF.h" #include "itkGradientAnisotropicDiffusionImageFilter.h" #include "vtkObjectFactory.h" class VTK_EXPORT vtkITKGradientAnisotropicDiffusionImageFilter : public vtkITKImageToImageFilterFF { public: static vtkITKGradientAnisotropicDiffusionImageFilter *New(); vtkTypeRevisionMacro(vtkITKGradientAnisotropicDiffusionImageFilter, vtkITKImageToImageFilterFF);

vtkITK: Wrapping void SetConductanceParameter ( double value ) { DelegateITKInputMacro ( SetConductanceParameter, value ); }; double GetConductanceParameter () DelegateITKOutputMacro(GetConductanceParameter) ; double GetTimeStep () DelegateITKOutputMacro(GetTimeStep) ; m_Filter.GetPointer()->SetConductanceParameter(value)

vtkITK: Wrapping protected: //BTX typedef itk::GradientAnisotropicDiffusionImageFilter<Superclass::InputImageType, Superclass::InputImageType> ImageFilterType; vtkITKGradientAnisotropicDiffusionImageFilter() : Superclass ( ImageFilterType::New() ){}; ~vtkITKGradientAnisotropicDiffusionImageFilter() {}; ImageFilterType* GetImageFilterPointer() { return dynamic_cast<ImageFilterType*> ( m_Filter.->GetPointer() ); //ETX private: vtkITKGradientAnisotropicDiffusionImageFilter(const vtkITKGradientAnisotropicDiffusionImageFilter&); // Not implemented. void operator=(const vtkITKGradientAnisotropicDiffusionImageFilter&); // Not implemented. }; vtkStandardNewMacro(vtkITKGradientAnisotropicDiffusionImageFilter);

Slicer Module ITKFilters.tcl Modules methods: core methods proc ITKFiltersInit proc ITKFiltersBuildGUI proc ITKFiltersBuildVTK proc ITKFiltersEnter proc ITKFiltersExit Other methods: callback methods proc ITKFiltersApply …..

Slicer Module proc ITKFiltersInit set m ITKFilters set Module($m,author) “NAMIC people" set Module($m,row1List) "Help Main" set Module($m,row1Name) "{Help} {Main}" set Module($m,row1,tab) Main set Module($m,procGUI) ITKFiltersBuildGUI set Module($m,procVTK) ITKFiltersBuildVTK set Module($m,procMRML) ITKFiltersUpdateGUI set Module($m,procEnter) ITKFiltersEnter set Module($m,procExit) ITKFiltersExit

Slicer Module proc ITKFiltersInit set ITKFilters(filters) " GradientAnisotropicDiffusionImageFilter “ set ITKFilters($filter,params) "SetConductanceParameter SetNumberOfIterations \ SetTimeStep" set param SetConductanceParameter set ITKFilters($filter,$param) 1 set ITKFilters($filter,$param,text) "Conductance" set ITKFilters($filter,$param,maxmin) "1 10“ set ITKFilters($filter,$param,res) 0.1 set ITKFilters($filter,$param,widget) "scale"

proc ITKFiltersBuildGUI Slicer Module proc ITKFiltersBuildGUI set fMain $Module(ITKFilters,fMain) set f $fMain foreach frame "Top Middle Floating Bottom" { frame $f.f$frame -bg $Gui(activeWorkspace) pack $f.f$frame -side top -padx 0 -pady $Gui(pad) -fill x } …..

proc ITKFiltersBuildGUI Slicer Module proc ITKFiltersBuildGUI "scale" { eval {label $fwidget.l$param -text $ITKFilters($filter,$param,text) \ -width 12 -justify right } $Gui(WLA) eval {entry $fwidget.e$param -justify right -width 4 \ -textvariable ITKFilters($filter,$param) } $Gui(WEA) eval {scale $fwidget.s$param \ -from [lindex $ITKFilters($filter,$param,maxmin) 0] \ -to [lindex $ITKFilters($filter,$param,maxmin) 1] \ -variable ITKFilters($filter,$param)\ -orient vertical \ -resolution $ITKFilters($filter,$param,res) } $Gui(WSA) pack $fwidget.l$param $fwidget.e$param $fwidget.s$param \ -side left -padx $Gui(pad) -pady 0 }

Slicer Module proc ITKFiltersApply #Preparing INPUT and OUTPUT volume If {$v2 == -5} { set name [Volume($v1,node) GetName] set v2 [DevCreateNewCopiedVolume $v1 "" ${name}_filter ] set node [Volume($v2,vol) GetMrmlNode] Mrml(dataTree) RemoveItem $node set nodeBefore [Volume($v1,vol) GetMrmlNode] Mrml(dataTree) InsertAfterItem $nodeBefore $node MainUpdateMRML } else { set v2name [Volume($v2,node) GetName] set continue [DevOKCancel "Overwrite $v2name?"] if {$continue == "cancel"} { return 1 } # They say it is OK, so overwrite! Volume($v2,node) Copy Volume($v1,node) }

Slicer Module proc ITKFiltersApply #Caster vtkImageCast _cast _cast SetOutputScalarTypeToFloat _cast SetInput [Volume($v1,vol) GetOutput] _cast Update #Create Object vtkITK$filter _filter foreach param $ITKFilters($filter,params) { _filter $param $ITKFilters($filter,$param) } _filter SetInput [_cast GetOutput]

Slicer Module proc ITKFiltersApply _filter AddObserver StartEvent MainStartProgress _filter AddObserver EndEvent MainEndProgress _filter AddObserver ProgressEvent "MainShowProgress _filter" _filter Update #Assign output [Volume($v2,vol) GetOutput] DeepCopy [_filter GetOutput] #Destroy pipeline _cast Delete _filter SetOutput "" _filter Delete

Demo

Enjoy!

vtkConnectVTKITK ITK itkMyFilterFF Slicer Module VTK ITK VTK CableSwig vtkImageExport itk::VTKImageImport itk::VTKImageExport vtkImageImport