static String getDiameterString(final ImageServer<BufferedImage> server, final ParameterList params) { if (server.hasPixelSizeMicrons()) return String.format("%.1f %s", params.getDoubleParameterValue("tileSizeMicrons"), GeneralTools.micrometerSymbol()); else return String.format("%d px", (int)(params.getDoubleParameterValue("tileSizePx") + .5)); }
static String getDiameterString(final ImageServer<BufferedImage> server, final ParameterList params) { if (server.hasPixelSizeMicrons()) return String.format("%.1f %s", params.getDoubleParameterValue("tileSizeMicrons"), GeneralTools.micrometerSymbol()); else return String.format("%d px", (int)(params.getDoubleParameterValue("tileSizePx") + .5)); }
static String getDiameterString(final ImageServer<BufferedImage> server, final ParameterList params) { if (server.hasPixelSizeMicrons()) return String.format("%.1f %s", params.getDoubleParameterValue("tileSizeMicrons"), GeneralTools.micrometerSymbol()); else return String.format("%d px", (int)(params.getDoubleParameterValue("tileSizePx") + .5)); }
public TilerPlugin() { // Set up initial parameters params = new ParameterList(); params.addTitleParameter("Tile options"); params.addDoubleParameter("tileSizeMicrons", "Tile size", 100, GeneralTools.micrometerSymbol(), "Specify tile width and height, in " + GeneralTools.micrometerSymbol()); params.addDoubleParameter("tileSizePx", "Tile size", 200, "px", "Specify tile width and height, in pixels"); params.addBooleanParameter("trimToROI", "Trim to ROI", true, "Trim tiles to match the parent ROI shape, rather than overlap boundaries with full squares"); params.addTitleParameter("Annotation options"); params.addBooleanParameter("makeAnnotations", "Make annotation tiles", false, "Create annotation objects, rather than tile objects"); params.addBooleanParameter("removeParentAnnotation", "Remove parent annotation", false, "Remove the parent object, if it was an annotation; has no effect if 'Make annotation tiles' is not selected, or the parent object is not an annotation"); }
static String getDiameterString(final ImageServer<BufferedImage> server, final ParameterList params) { RegionType regionType = (RegionType)params.getChoiceParameterValue("region"); String shape = regionType == RegionType.SQUARE ? "Square" : (regionType == RegionType.CIRCLE ? "Circle" : "ROI"); String unit = server.hasPixelSizeMicrons() ? GeneralTools.micrometerSymbol() : "px"; double pixelSize = server.hasPixelSizeMicrons() ? params.getDoubleParameterValue("pixelSizeMicrons") : params.getDoubleParameterValue("downsample"); double regionSize = server.hasPixelSizeMicrons() ? params.getDoubleParameterValue("tileSizeMicrons") : params.getDoubleParameterValue("tileSizePixels"); if (regionType == RegionType.ROI) { return String.format("ROI: %.2f %s per pixel", pixelSize, unit); } else { return String.format("%s: Diameter %.1f %s: %.2f %s per pixel", shape, regionSize, unit, pixelSize, unit); } }
public SmoothFeaturesPlugin() { params = new ParameterList() .addDoubleParameter("fwhmMicrons", "Radius (FWHM)", 25, GeneralTools.micrometerSymbol(), "Smoothing filter size - higher values indicate more smoothing") .addDoubleParameter("fwhmPixels", "Radius (FWHM)", 100, "pixels", "Smoothing filter size - higher values indicate more smoothing") .addBooleanParameter("smoothWithinClasses", "Smooth within classes", false, "Restrict smoothing to only be applied within objects with the same base classification") .addBooleanParameter("useLegacyNames", "Use legacy feature names", false, "Use previous naming strategy for smoothed features - only retained here for backwards compatibility") ; }
public CoherenceFeaturePlugin(final ImageRegionStore<BufferedImage> regionServer) { this.regionStore = regionServer; params = new ParameterList(). addDoubleParameter("magnification", "Magnification", 5). addChoiceParameter("stainChoice", "Stains", "Optical density", new String[]{"Optical density", "H-DAB", "H&E", "H-DAB (8-bit)", "H&E (8-bit)", "RGB", "Grayscale"}); params.addDoubleParameter("tileSizeMicrons", "Tile diameter", 25, GeneralTools.micrometerSymbol()); params.addDoubleParameter("tileSizePx", "Tile diameter", 200, "px (full resolution image)"); params.addBooleanParameter("includeStats", "Include basic statistics", true). addBooleanParameter("doCircular", "Use circular tiles", false); }
public HaralickFeaturesPlugin(final ImageRegionStore<BufferedImage> regionServer) { this.regionStore = regionServer; params = new ParameterList(). addDoubleParameter("downsample", "Downsample", 1, null, "Amount to downsample the image before calculating textures; choose 1 to use full resolution, or a higher value to use a smaller image"). addDoubleParameter("magnification", "Magnification", 5, null, "Magnification factor of the image used to calculate the textures"). addDoubleParameter("pixelSizeMicrons", "Preferred pixel size", 2, GeneralTools.micrometerSymbol(), "Preferred pixel size of the image used to calculate the tetures - higher values means coarser (lower resolution) images"). addChoiceParameter("stainChoice", "Color transforms", "Optical density", new String[]{"Optical density", "H-DAB", "H&E", "H-DAB (8-bit)", "H&E (8-bit)", "RGB OD", "RGB", "Grayscale", "HSB"}, "Color transforms to apply before calculating textures"); params.addDoubleParameter("tileSizeMicrons", "Tile diameter", 25, GeneralTools.micrometerSymbol(), "Diameter of square tile around the object centroid used to calculate textures.\nIf <= 0, the tile itself will be used to defined the ROI in which textures are calculated"); params.addDoubleParameter("tileSizePx", "Tile diameter", 200, "px (full resolution image)", "Diameter of square tile around the object centroid used to calculate textures.\nIf <= 0, the tile itself will be used to defined the ROI in which textures are calculated"); params.addBooleanParameter("includeStats", "Include basic statistics", true, "Include basic statistics (mean, min, max, std dev) as well as Haralick textures"). addBooleanParameter("doCircular", "Use circular tiles", false, "If the tile diameter > 0, calculate textures in a circular (rather than square) region around the centroid of each object"). addBooleanParameter("useNucleusROIs", "Use cell nucleus ROIs", true, "If textures are computed around cell objects, the nucleus ROI is used where available"). addIntParameter("haralickDistance", "Haralick distance", 1, null, "Spacing between pixels used in computing the co-occurrence matrix for Haralick textures (default = 1)"). addIntParameter("haralickBins", "Haralick number of bins", 32, null, 8, 256, "Number of intensity bins to use when computing the co-occurrence matrix for Haralick textures (default = 32)"); }
public LocalBinaryPatternsPlugin(final ImageRegionStore<BufferedImage> regionServer) { this.regionStore = regionServer; params = new ParameterList(). addDoubleParameter("magnification", "Magnification", 5). addChoiceParameter("stainChoice", "Stains", "Optical density", new String[]{"Optical density", "H-DAB", "H&E", "H-DAB (8-bit)", "H&E (8-bit)", "RGB", "Grayscale"}); params.addDoubleParameter("tileSizeMicrons", "Tile diameter", 25, GeneralTools.micrometerSymbol()); params.addDoubleParameter("tileSizePx", "Tile diameter", 200, "px (full resolution image)"); params.addBooleanParameter("includeStats", "Include basic statistics", false). addBooleanParameter("doCircular", "Use circular tiles", false); }
public ShapeFeaturesPlugin() { params = new ParameterList() .addTitleParameter("Measurements") .addBooleanParameter("area", "Area", true, "Compute area of ROI") .addBooleanParameter("perimeter", "Perimeter", false, "Compute perimeter of ROI") .addBooleanParameter("circularity", "Circularity", false, "Compute circularity of ROI, between 0 (a line) and 1 (a circle)") .addTitleParameter("Units") .addBooleanParameter("useMicrons", "Use microns", true, "Compute measurements using " + GeneralTools.micrometerSymbol() + ", where possible"); }
if (server != null && server.hasPixelSizeMicrons()) { fwhm = getParameterList(imageData).getDoubleParameterValue("fwhmMicrons"); fwhmStringTemp = GeneralTools.createFormatter(2).format(fwhm) + " " + GeneralTools.micrometerSymbol(); fwhm /= server.getAveragedPixelSizeMicrons();
addDoubleParameter("pixelSizeMicrons", "Preferred pixel size", 2, GeneralTools.micrometerSymbol(), "Preferred pixel size of the image used to calculate the tetures - higher values means coarser (lower resolution) images") params.addDoubleParameter("tileSizeMicrons", "Tile diameter", 25, GeneralTools.micrometerSymbol(), "Diameter of tile around the object centroid used to calculate textures.\nOnly matters if tiles are being used (i.e. the region parameter isn't ROI)."); params.addDoubleParameter("tileSizePixels", "Tile diameter", 200, "px (full resolution image)", "Diameter of tile around the object centroid used to calculate textures.\nOnly matters if tiles are being used (i.e. the region parameter isn't ROI).");
String unit = useMicrons ? GeneralTools.micrometerSymbol() : "px";