1 / 18

Object-oriented application development with MeVisLab and Python

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.

paytah
Download Presentation

Object-oriented application development with MeVisLab and Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object-oriented application development with MeVisLab and Python Frank Heckel Michael Schwier Heinz-Otto Peitgen

  2. What I am goingto talk about • Development of (medical) software assistants • Issues in multilevel development approaches (MeVisLab) • Object-oriented programming

  3. Rapid ApplicationPrototypingwith MeVisLab • Visual development environment for medical image processing and visualization

  4. 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 implementation Script Visual C++

  5. Module/C++ Level  Network Level  Script Level C++ Module Int Float String Image

  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

  7. Giving a programmer this much freedom …

  8. Let‘sbuild an application • Load a BL and/or FU dataset that have been specified in the GUI • Switch to a proper GUI configuration if successful

  9. Example LoadData_filename baselineFilename filename LoadData_valid valid followupFilename loadButton Import

  10. Call-Chain baselineFilename LoadData_filename filename followupFilename LoadData_valid valid loadButton • GUI • LoadData • DataProcessing Connection Connection Event Set Set Event Event defloadButtonPressed(field): ifctx.field(“baselineFilename”).value != “” ... state = “BL_AND_FU” ... GlobalState deffilenameChanged(field): # loading stuff ... ifloadSuccessful: ctx.field(“valid”).value = True else: ctx.field(“valid”).value = False defbaseline_LoadDataDone(field): if state == “BL_AND_FU”: ifnot successful: ... IMPLICIT

  11. Networks can get complex and confusing Can you imagine the network script?

  12. Join Script and Module • Module • Module

  13. Concept DataProcessing LoadData GUI context: Network parent: Reference … context: Network parent: Reference dataProcessing: Reference … context: Network parent: Reference loadData: Reference … init (ctx: Network, child: Reference): void setParent (parent: Reference): void getField (field: String): String/Int/Float loadFile (filename: String): Boolean DataProcessing GUI LoadData init (ctx: Network, child: Reference): void setParent (parent: Reference): void getField (field: String): String/Int/Float loadFile (filename: String): Boolean init (ctx: Network, child: Reference): void setParent (parent: Reference): void getField (field: String): String/Int/Float loadFile (filename: String): Boolean

  14. Integration in MeVisLab DataProcessing Init context: Network parent: Reference loadData: Reference … ## global reference to this modules instance this = None ## access method to the global this object defgetThis(): global this return this ## the init method creates the global object ## (one class instance per module instance) definit(ctx): global this loadData = ctx.module(“LoadData”).call(“getThis”) this = DataProcessing(ctx, loadData) return init (ctx: Network, child: Reference): void setParent (parent: Reference): void getField (field: String): String/Int/Float loadFile (filename: String): Boolean DataProcessing

  15. Integration in MeVisLab ## global reference to this modules instance this = None ## access method to the global this object defgetThis(): global this return this ## the init method creates the global object ## (one class instance per module instance) definit(ctx): global this loadData= ctx.module(“LoadData”).call(“getThis”) this = DataProcessing(ctx, loadData) return DataProcessing Init context: Network parent: Reference loadData: Reference … ## global reference to this modules instance this = None ## access method to the global this object defgetThis(): global this return this ## the init method creates the global object ## (one class instance per module instance) definit(ctx): global this loadData = ctx.module(“LoadData”).call(“getThis”) this = DataProcessing(ctx, loadData) return init (ctx: Network, child: Reference): void setParent (parent: Reference): void getField (field: String): String/Int/Float loadFile (filename: String): Boolean DataProcessing

  16. Call chain baselineFilename followupFilename loadButton • GUI • LoadData • DataProcessing Event defloadData(self): ifself.getfield("baselineFilename").value != ""andself.getfield("follo... ifself.baselineScan.loadFile( self.getfield("baselineFilename").value ): ifself.followupScan.loadFile( self.getfield("followupFilename").value ): # switch to bl+fu layout... else: ... defloadFile(self, filename): # loading stuff ... returnloadSuccessful defloadFile(self, filename): returnloadData.loadFile(filename) Call Call EXPLICIT

  17. The Essence Use object oriented programming (wisely) … … even if it‘s tempting not to do it!

  18. The Essence Use object oriented programming (wisely) … … even if it‘s tempting not to do it! The users/clinicians will profit.

More Related