Package noduledata.imagej
Class ColorData
java.lang.Object
noduledata.imagej.ColorData
- Direct Known Subclasses:
MixedData
This class handles the analysis of the segmented nodule Rois.
- Author:
- Brandin Farris
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionColorData
(ij.plugin.frame.RoiManager manager, int[] color, int colorThreshold, ij.ImagePlus im) constructor method. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRoi
(ij.gui.ShapeRoi roi) add given roi to array of Roisdouble
calculates average area of the singular nodules.ij.ImagePlus
converts map to binary map.static ij.ImagePlus
createImageWithRoi
(ij.ImagePlus image, ij.gui.Roi[] rois) Generates a map given a background image and ROIs.static ij.process.ImageProcessor
fills given rect with given color.int[][]
getArea()
areas[][[] is nx2 with n Rois.double
getCircularity
(int index) Returns the circularity of the roi at the given index.getClump
(int index) Returns clump at given index.void
getData
(boolean mixed) Method that generates the ResultsTable, ROI's, int[] areas, and numNodules.
Finds all ROIs using the measure method.
Finds any rois with large enough measure, and fills them in.int
getIndex
(ij.gui.Roi roi) returns index of given roi or -1 if Roi is not found.ij.ImagePlus
getMap()
Returns the binary map for this ColorData object.int[]
Returns the array of pixels that are nodule pixels of this type.ij.gui.ShapeRoi
getRoi
(int index) returns Roi at given indexij.gui.ShapeRoi[]
getRois()
returns array of all rois.ij.measure.ResultsTable
getTable()
Returns the given ResultsTablevoid
removeArrayOfRois
(int[] indices) removes the data for the given indices.boolean
removeRoi
(ij.gui.ShapeRoi roi) void
Uses aspect ratio and area to locate and remove fluoresced roots caught in initial segmentationvoid
save data as CSV file.void
setMap
(ij.ImagePlus map) Sets or updates the binary map.void
setPixels
(int[] pixels) Sets the pixels that are counted as nodule pixels of this type.void
setRoi
(int index, ij.gui.ShapeRoi roi) Replaces ROI at the given index with new ROI Does nothing if index is invalid.void
setRois
(ij.gui.ShapeRoi[] rois) updater method for the array of ROI'svoid
setTable
(ij.measure.ResultsTable table) Sets the ImageJ ResultsTable object.void
Creates an annotated version of the map and displays it.void
showMap()
Show's the map using ImageJ API.void
VisualizeRoi
(ij.ImagePlus im, ij.gui.Roi roi, boolean boxRoi) Shows the RG color distribution graph for the given Roi
-
Field Details
-
COLOR
public final int[] COLOR -
image
protected ij.ImagePlus image -
numNodules
public int numNodules
-
-
Constructor Details
-
ColorData
public ColorData(ij.plugin.frame.RoiManager manager, int[] color, int colorThreshold, ij.ImagePlus im) constructor method.- Parameters:
manager
- : RoiManager object. It's best practice to not have multiple of this object.color
- : the color of the class of roi's of interest.colorThreshold
- : area threashold for a single nodule of this type.im
- : image we're doing analysis on.
-
-
Method Details
-
getClump
Returns clump at given index. -
getClumps
- Returns:
- returns this object's array of clump objects.
-
showMap
public void showMap()Show's the map using ImageJ API. -
setRoi
public void setRoi(int index, ij.gui.ShapeRoi roi) Replaces ROI at the given index with new ROI Does nothing if index is invalid. -
setRois
public void setRois(ij.gui.ShapeRoi[] rois) updater method for the array of ROI's- Parameters:
rois
-
-
getRois
public ij.gui.ShapeRoi[] getRois()returns array of all rois.- Returns:
-
getRoi
public ij.gui.ShapeRoi getRoi(int index) returns Roi at given index -
getIndex
public int getIndex(ij.gui.Roi roi) returns index of given roi or -1 if Roi is not found. -
addRoi
public void addRoi(ij.gui.ShapeRoi roi) add given roi to array of Rois -
removeRoi
public boolean removeRoi(ij.gui.ShapeRoi roi) - Parameters:
roi
- removes the given ROI from list of rois.
-
removeArrayOfRois
public void removeArrayOfRois(int[] indices) removes the data for the given indices. -
setMap
public void setMap(ij.ImagePlus map) Sets or updates the binary map.- Parameters:
map
-
-
getArea
public int[][] getArea()areas[][[] is nx2 with n Rois. For roi "i", [i][0] is numNodules in that Roi, [i][1] is total area of ROI. -
getMap
public ij.ImagePlus getMap()Returns the binary map for this ColorData object.- Returns:
-
setTable
public void setTable(ij.measure.ResultsTable table) Sets the ImageJ ResultsTable object. It's best practice to not have more than oen of these objects at a time.- Parameters:
table
-
-
getTable
public ij.measure.ResultsTable getTable()Returns the given ResultsTable- Returns:
-
setPixels
public void setPixels(int[] pixels) Sets the pixels that are counted as nodule pixels of this type.- Parameters:
pixels
-
-
getPixels
public int[] getPixels()Returns the array of pixels that are nodule pixels of this type.- Returns:
-
showAnnotatedMap
public void showAnnotatedMap()Creates an annotated version of the map and displays it. -
fillRect
fills given rect with given color.- Parameters:
rect
- : rect object to fill in with whiteip
- : imageprocessor object to color onto.- Returns:
- : imageprocessor with the the white square filled in.
-
createImageWithRoi
public static ij.ImagePlus createImageWithRoi(ij.ImagePlus image, ij.gui.Roi[] rois) Generates a map given a background image and ROIs. -
getData
public void getData(boolean mixed) Method that generates the ResultsTable, ROI's, int[] areas, and numNodules.
Finds all ROIs using the measure method.
Finds any rois with large enough measure, and fills them in.
measures again to account for filled in holes.
removes noise from dataset
splits mixed nodules- Parameters:
mixed
- : true if this colordata object is for mixed nodules, false otherwise.
-
removeRoots
public void removeRoots()Uses aspect ratio and area to locate and remove fluoresced roots caught in initial segmentation -
saveTable
public void saveTable()save data as CSV file. -
convertToBinary
public ij.ImagePlus convertToBinary()converts map to binary map. -
getCircularity
public double getCircularity(int index) Returns the circularity of the roi at the given index.- Parameters:
index
-- Returns:
-
averageArea
public double averageArea()calculates average area of the singular nodules. -
VisualizeRoi
public void VisualizeRoi(ij.ImagePlus im, ij.gui.Roi roi, boolean boxRoi) Shows the RG color distribution graph for the given Roi- Parameters:
im
- : a copy of the original imageroi
- : roi to graphboxRoi
- : if true, will graph the pixels around the roi as well. If false, will only graph the pixels within the roi.
-