-
Notifications
You must be signed in to change notification settings - Fork 0
ROIM
##1. Introduction Roim is a class library designed to help implementing software for processing nuclear medicine (hereinafter NM) data. This development was inspired by ImageJ image viewer and written in Java. It is designed to be vendor neutral and shall support most of modalities. Among tested are NM/DR/DXR/CT/PET/MR. It has implementations for a set of controls, screen primitives and algorithms to extract, process and display biomedical information hidden in study files. These include:
- regions of interest (hereinafter ROI) of rectangular, elliptic and free form shape - once ROI is created it can be moved, reshaped, deleted, pinned, etc and a set of characteristics can be measured. Among them area (in pixels and cm), integral density (i.e. arithmetic sum of pixel values), min/max/avg pixel. For the case multiframe image - often seen in NM - this information will be extracted out of all the frames and then one will have a possibility to build and display curves like "density over time";
- measure - it is meant for extracting geometrical information of the images;
- profile - a tool to display density profile over a rectangular area of an image; Beyound aforementioned tools there is a number of instruments to adjust visualization parameters W/L and apply presentation LUT (a dozen of most popular ones is built into and there exists a possibility to load LUT from files in NIH format). Frame selection bar provides a mechanism of navigating through multiframe/multi-phase images in either terms of frames or time (milliseconds).
- Using ROI calculator it is possible to apply basic maths to measurements. For instance: one of often necessary operation is subtraction of background counts of counts measured from a ROI. Then, the resulting series can be sent to chart control.
- Chart control is built around JFreeChart library and is designated to visualize series as curves, extract numeric information and finally there is an instrument to fit experimental data with linear or exponential polynomials using least squares method. It is not seldom acquisition ends earlier than a particular event takes place for instance half excretion a time in the case of renal obstruction, however, using this tool it is possible to extrapolate the experimental data thus get in many cases acceptable approximation of missing parameter. The library employs DCM4CHE library to handle DICOM data and aparapi to engage GPU into data processing. Finally the library includes several applications for the sake of illustration of the basic concepts and principles behind the design.
##2. Starting an application on roim
Basically there are several ways depending on the functionality and data presentation one shall be preferred over others.
The first and the simplest one employs ImageView class it is suitable for application of single view
###2.1 Using ImageView
the easiest way is to create an instance of ImageView class and add it into JPanel based container, assuming the container assigned BorderLayout the code might look like following. Last two lines add LUT and Frame controls right and bottom of the container respectively.
FileDialog fd = new FileDialog(this, "Choose", FileDialog.LOAD);
fd.setFile("*.dcm");
fd.setFilenameFilter((File dir, String name) -> name.endsWith(".dcm") || name.endsWith(".dicom"));
fd.setVisible(true);
if (null != fd.getFile()) {
IMultiframeImage dcm = ImageFactory.create(fd.getDirectory() + fd.getFile());
ImageView image = ImageView.create(dcm, ImageView.DEFAULT_IMAGE_MODE);
iPanel.add(image, BorderLayout.CENTER);
iPanel.add(LUTControl.create(image), BorderLayout.LINE_END);
iPanel.add(FrameControl.create(image), BorderLayout.PAGE_END);
}
###2.2 Using ImageViewGroup
Not seldom it is the best to display an image with different presentation parameters for instance LUT or intensity or even show frame by frame and composite frame (a frame composed of a set of frames within a particular range) the same time.
Following piece of code exemplifies this concept.
ImageViewGroup iGroup = ImageViewGroup.create(anImage);
ImageView image = iGroup.createView(ImageView.DEFAULT_IMAGE_MODE);
jPanel1.add(image, BorderLayout.CENTER);
jPanel1.add(LUTControl.create(image), BorderLayout.LINE_END);
jPanel1.add(FrameControl.create(image), BorderLayout.PAGE_END);
ImageView sumView = iGroup.createView(ImageView.DEFAULT_COMPOSITE_IMAGE_MODE);
jPanel3.add(sumView, BorderLayout.CENTER);
jPanel3.add(LUTControl.create(sumView), BorderLayout.LINE_END);
ImageView gridView = iGroup.createGridView();//ImageView.create(sum, root);
jPanel4.add(gridView, BorderLayout.CENTER);
jPanel4.add(LUTControl.create(gridView), BorderLayout.LINE_END);
That is! ###3 Maven integration
In order to include Roim in Maven project all is needed to add following two sections into project's pom file:
<dependency>
<groupId>com.github.ivli</groupId>
<artifactId>roim</artifactId>
<version>v0.9.6</version>
</dependency>
and do not forget to add github based repository
<repository>
<id>ROIM-mvn-repo</id>
<url>https://raw.github.com/ivli/roim/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
Good luck.
I.