Presentation is loading. Please wait.

Presentation is loading. Please wait.

Plugins, Part 1 1 2 Medical Image Processing, Analysis & Visualization & Plugins Justin Senseney

Similar presentations


Presentation on theme: "Plugins, Part 1 1 2 Medical Image Processing, Analysis & Visualization & Plugins Justin Senseney"— Presentation transcript:

1 Plugins, Part 1 1 http://mipav.cit.nih.gov

2 2 Medical Image Processing, Analysis & Visualization & Plugins Justin Senseney SenseneyJ@mail.nih.govdcb.cit.nih.gov/~senseneyj Biomedical Image Processing Research Services Section Center for Information Technology mipav.cit.nih.gov

3 3 MIPAV Team Employees Ruida Cheng William Gandler Matthew McAuliffe Evan McCreedy Justin Senseney Fellows Sara Shen Contractors Alexandra Bokinsky, Geometric Tools Inc. (Visualization) Olga Vovk, SRA International Inc. (Technical Writing) Alumni Paul Hemler, Agatha Munzon, Nishith Pandya, Beth Tyriee, Hailong Wang

4 Mipav Interface 4 Options exist How to manipulate

5 5

6 Plugins PlugInAlgorithm – Develop new functionality and ability to call functions already in MIPAV.PlugInAlgorithm – Develop new functionality and ability to call functions already in MIPAV. PlugInFile – Develop files readers to support unique file formats.PlugInFile – Develop files readers to support unique file formats. PlugInGeneric – Plugins that do not require an open image.PlugInGeneric – Plugins that do not require an open image. PlugInView – Develop new visualizations of datasets.PlugInView – Develop new visualizations of datasets. PlugIn – ImageJ plugin.PlugIn – ImageJ plugin. 6

7 Plugins To build a plugin, three files are typically used:To build a plugin, three files are typically used: –PlugInTest.class Interface between MIPAV and plugin.Interface between MIPAV and plugin. –PlugInDialogTest.class Creates dialog for input.Creates dialog for input. –PlugInAlgorithmTest.class The actual algorithm.The actual algorithm. 7

8 Plugins - Location Stored for each user:Stored for each user: –Windows - C:\Users\{{user_name}}\mipav\plugins –Linux/Mac OS - /home/{{user_name}}/mipav/plugins 8

9 Plugins - Installing 9

10 Plugins – Installing Installing a plugin ()Installing a plugin (Plugins -> Install Plugin) 10 Copies files:.class.jar.zip into user directory. HINT: If something goes wrong, just copy the files yourself using locations on Slide 8.

11 Plugins – Installing (2) 11

12 Plugins - Executing 12

13 Plugins - Scripting 13 Execute plugin

14 Script Running Review 14

15 Uninstall Plugin 15

16 Plugin Lab InstallInstall PlugInCT_MD – already in MIPAVPlugInCT_MD – already in MIPAV MuscleSegmentation –MuscleSegmentation – http://dcb.cit.nih.gov/~senseneyj/code/muscleSeg.html Bio-Formats - http://dcb.cit.nih.gov/~senseneyj/code/bioformats.htmlBio-Formats - http://dcb.cit.nih.gov/~senseneyj/code/bioformats.html http://dcb.cit.nih.gov/~senseneyj/code/bioformats.html ImageJ plugin –ImageJ plugin – http://dcb.cit.nih.gov/~senseneyj/code/imagej.html 16

17 Plugins from command line 17 Mipav –p Plugin_NameMipav –p Plugin_Name Can be run headlessCan be run headless

18 Break - Review 18 PluginsPlugins FileFile GenericGeneric AlgorithmAlgorithm ViewView Stored in user folderStored in user folder Install, Run, UninstallInstall, Run, Uninstall

19 Development environment 19 Textpad: http://www.textpad.com/Textpad: http://www.textpad.com/http://www.textpad.com/ Simple, few linked filesSimple, few linked files Want to learn JavaWant to learn Java Eclipse: http://www.eclipse.org/Eclipse: http://www.eclipse.org/http://www.eclipse.org/ Many files, librariesMany files, libraries Source repositorySource repository Want to use JavaWant to use Java

20 Download Eclipse 20 Download here:Download here: http://www.eclipse.org/downloads/

21 “Install” Eclipse 21

22 Fix Eclipse 22 Specify Memory

23 Start Eclipse 23

24 Java Programs 24 Virtual machine = platform independentVirtual machine = platform independent JRE to executeJRE to execute

25 JRE Setting 25

26 Add JRE 26

27 Locate JRE 27

28 Locate JRE 28

29 Eclipse project 29 MipavMipav Java projectJava project Contains pluginsContains plugins

30 Make Mipav Project 30

31 Make Mipav Project 31 Specify JRE

32 Mipav Program 32 Execution environment needs to be replicatedExecution environment needs to be replicated

33 Execution environment 33 ClasspathClasspath Libraries - jarsLibraries - jars Associated class filesAssociated class files Memory – used by VMMemory – used by VM Launching class fileLaunching class file

34 Jars 34 LibrariesLibraries PDFboxPDFbox JPEG2000JPEG2000 ImageJImageJ Help filesHelp files Insight Toolkit wrappersInsight Toolkit wrappers

35 Add Jars 35

36 More Jars 36

37 More Jars: Help 37

38 More Jars: ITK 38

39 Class files 39 Object-orientedObject-oriented Executable programsExecutable programs In Mipav:In Mipav: Read/write imagesRead/write images Apply filtersApply filters Run plugins!Run plugins!

40 External class folder 40 Select the correct version of Mipav

41 Click Finish! 41 Note class folder and JRE selection

42 MipavMain 42

43 Run Configuration 43

44 New Configuration 44

45 Select Main Type 45

46 Java Memory 46 -Xms (min), -Xmx (max)

47 Memory 47

48 Run Mipav 48 MipavMain is executedMipavMain is executed Classpath is setClasspath is set Memory allocatedMemory allocated Libraries are referencedLibraries are referenced

49 Mipav Launched 49 Version number VM Memory

50 View JVM Info 50

51 JVM Info 51 JRE in mipav Plugin folder in workspace

52 Java Compiler 52 Source code:Source code: *.java files*.java files Text-editor readableText-editor readable Platform independent byte-code:Platform independent byte-code: *.class files*.class files

53 Get NewGeneric542 53 Download three files from http://dcb.cit.nih.gov/~senseneyj/code/plugin.htmlDownload three files from http://dcb.cit.nih.gov/~senseneyj/code/plugin.html http://dcb.cit.nih.gov/~senseneyj/code/plugin.html PlugInNewGeneric542.javaPlugInNewGeneric542.java PlugInDialogNewGeneric542.javaPlugInDialogNewGeneric542.java PlugInAlgorithmNewGeneric542.javaPlugInAlgorithmNewGeneric542.java

54 Import NewGeneric542 54 In Eclipse: Press File->ImportIn Eclipse: Press File->Import

55 Compile NewGeneric542 55 This is done for you, incrementally in EclipseThis is done for you, incrementally in Eclipse Errors and warnings update with each changeErrors and warnings update with each change

56 Install NewGeneric542 56 Only install PlugInNewGeneric542.classOnly install PlugInNewGeneric542.class Why did this work?

57 Run NewGeneric542 57 Open an image, try it outOpen an image, try it out

58 Plugins - Documentation 58 Plugin development documentation http://mipav.cit.nih.gov/documentation/userguide/volume1/MIPAV_PlugIns.pdf This presentation is posted at: http://dcb.cit.nih.gov/~senseneyj/code/plugin.html Will also be posted here: http://mipav.cit.nih.gov/documentation/presentations/ Also see this wiki page: http://mipav.cit.nih.gov/pubwiki/index.php/Writing_MIPAV_plugins_without_MIPA V_source_code#Requirementshttp://mipav.cit.nih.gov/pubwiki/index.php/Writing_MIPAV_plugins_without_MIPA V_source_code#Requirements

59 Plugins, Part 2 59 http://mipav.cit.nih.gov

60 Look at NewGeneric542 60 Open Dialog, try to change the title “Generic Plugin”Open Dialog, try to change the title “Generic Plugin”

61 Change NewGeneric542 61 Location:Location:

62 Run NewGeneric542 62 See change:See change:

63 NewGeneric Algorithm 63 Look at algorithm construction, executionLook at algorithm construction, execution

64 MIPAV Documentation 64 CTRL-click on run algorithm, now try hovering:CTRL-click on run algorithm, now try hovering:

65 Plugins - MIPAV API 65 Download from: http://mipav.cit.nih.gov/documentation/api.zip

66 Plugins - MIPAV API 66 Attach here:

67 Plugins - MIPAV API 67 View here:

68 ModelImage 68 Data stored in 1D array. Color, complex images use multiple indices per pixel. Export()/Import()

69 ViewJFrameImage 69 Contains ModelImage Example of frame enclosing GUI components Refreshed to reflect changes

70 JDialogBase 70 GUI component for collecting user/image input Extends java awt/swing packages Listens for algorithm completion Point of entry/exit for algorithms

71 AlgorithmBase 71 Performs image processing Constructor, get/set use Standard processing components for extension

72 Modify Plugin Lab 72 Edit PlugInNewGeneric542: Change text in plugin dialog. Print out when algorithm has completed. Increase kernel size. Change 3D to 2.5D processing. Add check box to allow user to select either 3D or 2.5D processing. Pre-process image by thresholding all pixels below a given intensity value. 10pt 20pt 30pt

73 Plugins - Documentation 73 Plugin development documentation http://mipav.cit.nih.gov/documentation/userguide/volume1/MIPAV_PlugIns.pdf This presentation is posted at: http://dcb.cit.nih.gov/~senseneyj/code/plugin.html Will also be posted here: http://mipav.cit.nih.gov/documentation/presentations/ Also see this wiki page: http://mipav.cit.nih.gov/pubwiki/index.php/Writing_MIPAV_plugins_without_MIPA V_source_code#Requirementshttp://mipav.cit.nih.gov/pubwiki/index.php/Writing_MIPAV_plugins_without_MIPA V_source_code#Requirements

74 Summary PluginsPlugins –Unique functionality using MIPAV API Develop in EclipseDevelop in Eclipse Use MIPAV APIUse MIPAV API 74

75 75 Visualization File reader QuantificationFile writer ProcessingMacros

76 http://mipav.cit.nih.gov SenseneyJ@mail.nih.gov http://mipav.cit.nih.gov SenseneyJ@mail.nih.gov 76


Download ppt "Plugins, Part 1 1 2 Medical Image Processing, Analysis & Visualization & Plugins Justin Senseney"

Similar presentations


Ads by Google