Upload
paytah
View
102
Download
0
Embed Size (px)
DESCRIPTION
Object-oriented application development with MeVisLab and Python. Frank Heckel Michael Schwier Heinz-Otto Peitgen. What I am going to talk about. Development of (medical) software assistants Issues in multilevel development approaches (MeVisLab) Object-oriented programming. - PowerPoint PPT Presentation
Citation preview
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 1
Object-oriented application development with MeVisLab and Python
Frank HeckelMichael Schwier
Heinz-Otto Peitgen
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 2
What I am going to talk about
› Development of (medical) software assistants› Issues in multilevel development approaches (MeVisLab)› Object-oriented programming
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 3
Rapid Application Prototyping with MeVisLab
› Visual development environment for medical image processing and visualization
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 4
Script
Multilevel Development Approach
› Application Level» GUI design» Application logic
› Network Level» Image processing and visualization processes» Based on library of modules
› Module » Low-level algorithm implementationC++
Visual
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 5
Module/C++ Level Network Level Script Level
C++ Module
Int Float String
Image
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 6
The typical script level problem
› They form a global layer upon the network» Practically no access limitations» No scope bound to a subnetwork or modules
› Initial intention was to use it for short code snippets» Convenience (no need to get back to C++/recompile/restart)» Short conditional logic
› Since it’s so easy …» Developers put more and more logic and processing into the script
› Applications naturally need a lot of code upon the network» Controlling the data flow» Interaction» …
› Programmers tend to take Script programming not so serious
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 7
Giving a programmer this much freedom …
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 8
Let‘s build an application
› Load a BL and/or FU dataset that have been specified in the GUI › Switch to a proper GUI configuration if successful
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 9
Example
GUI
DataProcessing
LoadData
User Interface
Data Processing
Specific ModulesbaselineFilename
followupFilename
loadButton
LoadData_filename filename
LoadData_valid valid
Import
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 10
Call-Chain
GUI DataProcessing LoadData
baselineFilename
followupFilename
loadButton
LoadData_filename filename
LoadData_valid valid
def loadButtonPressed(field): if ctx.field(“baselineFilename”).value != “” ... state = “BL_AND_FU” ...
def baseline_LoadDataDone(field):if state == “BL_AND_FU”: if not successful: ...
def filenameChanged(field):
# loading stuff ...
if loadSuccessful: ctx.field(“valid”).value = True else: ctx.field(“valid”).value = False
Event
Set
Connection
EventSet
Event
GlobalState
Connection
IMPLICIT
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 11
Networks can get complex and confusing
Can you imagine the network script?
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 12
Join Script and Module
Module
Module
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 13
Concept
DataProcessingcontext: Networkparent: ReferenceloadData: Reference…init (ctx: Network, child: Reference): voidsetParent (parent: Reference): voidgetField (field: String): String/Int/Float
loadFile (filename: String): Boolean
DataProcessing
GUI
context: Networkparent: ReferencedataProcessing: Reference…
init (ctx: Network, child: Reference): voidsetParent (parent: Reference): voidgetField (field: String): String/Int/Float
loadFile (filename: String): Boolean
LoadData
context: Networkparent: Reference…
init (ctx: Network, child: Reference): voidsetParent (parent: Reference): voidgetField (field: String): String/Int/Float
loadFile (filename: String): Boolean
GUI LoadData
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 14
Integration in MeVisLab
DataProcessingInit
## global reference to this modules instancethis = None
## access method to the global this objectdef getThis(): global this return this
## the init method creates the global object## (one class instance per module instance)def init(ctx): global this loadData = ctx.module(“LoadData”).call(“getThis”)
this = DataProcessing(ctx, loadData)
return
DataProcessing
context: Networkparent: ReferenceloadData: Reference…
init (ctx: Network, child: Reference): voidsetParent (parent: Reference): voidgetField (field: String): String/Int/Float
loadFile (filename: String): Boolean
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 15
Integration in MeVisLab
DataProcessingInit
## global reference to this modules instancethis = None
## access method to the global this objectdef getThis(): global this return this
## the init method creates the global object## (one class instance per module instance)def init(ctx): global this loadData = ctx.module(“LoadData”).call(“getThis”)
this = DataProcessing(ctx, loadData)
return
DataProcessing
context: Networkparent: ReferenceloadData: Reference…
init (ctx: Network, child: Reference): voidsetParent (parent: Reference): voidgetField (field: String): String/Int/Float
loadFile (filename: String): Boolean
## global reference to this modules instancethis = None
## access method to the global this objectdef getThis(): global this return this
## the init method creates the global object## (one class instance per module instance)def init(ctx): global this loadData= ctx.module(“LoadData”).call(“getThis”)
this = DataProcessing(ctx, loadData)
return
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 16
Call chain
GUI DataProcessing LoadData
baselineFilename
followupFilename
loadButton
def loadData(self): if self.getfield("baselineFilename").value != "" and self.getfield("follo... if self.baselineScan.loadFile( self.getfield("baselineFilename").value ): if self.followupScan.loadFile( self.getfield("followupFilename").value ): # switch to bl+fu layout... else: ...
def loadFile(self, filename): return loadData.loadFile(filename)
EXPLICIT
def loadFile(self, filename): # loading stuff ... return loadSuccessful
Event
Call Call
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 17
The Essence
Use object oriented programming (wisely) …
… even if it‘s tempting not to do it!
Fraunhofer MEVIS Institute for Medical Image Computing 01.10.2009 INFORMATIK 2009 – Softwareassistenten in der Medizin 18
The Essence
Use object oriented programming (wisely) …
… even if it‘s tempting not to do it!
The users/clinicians will profit.