public class StainMatrix extends Object
boolean showMatrix=false;//To not display the Matrix used to do the deconvolution in a popup at the end of the process
boolean hideLegend=true; //To not display the deconvolution legend in a popup at the end of the process
mt = new StainMatrix(); // Create a new Matrix_Custom
//Populate the Transformation Matrix
mt.getMODx()[0]=0.650;
mt.getMODy()[0]=0.704;
mt.getMODz()[0]=0.286;
mt.getMODx()[1]=0.072;
mt.getMODy()[1]=0.990;
mt.getMODz()[1]=0.105;
mt.getMODx()[2]=0.268;
mt.getMODy()[2]=0.570;
mt.getMODz()[2]=0.776; // Create a new MatrixTransformation corresponding to your stain.
//Compute the Deconvolution images and return a Stack array of three 8-bit images.
ImageStack[] stacks = mt.compute(showMatrix, hideLegend, imp);
//Then if you want to display them:
new ImagePlus(title+"-(Colour_1)",stack[0]).show();
new ImagePlus(title+"-(Colour_2)",stack[1]).show();
new ImagePlus(title+"-(Colour_3)",stack[2]).show();
If you want to perform it from a ROIs, you need to have 3 ROIs, one for each Colour:
boolean showMatrix=false; //To not display the Matrix used to do the deconvolution in a popup at the end of the process
boolean hideLegend=true; //To not display the deconvolution legend in a popup at the end of the process
// Create a new Custom Matrix Transformation and give 3 ROIs, one for each Colour
mt = new Matrix_Custom(rois, imp.getProcessor);// Create a new Matrix_Custom and populate the Transformation Matrix from the ROIs
//Compute the Deconvolution images and return a Stack array of three 8-bit images.
ImageStack[] stacks = mt.compute(showMatrix, hideLegend, imp);
Then if you want to display them:
new ImagePlus(title+"-(Colour_1)",stack[0]).show();
new ImagePlus(title+"-(Colour_2)",stack[1]).show();
new ImagePlus(title+"-(Colour_3)",stack[2]).show();Constructor and Description |
---|
StainMatrix() |
Modifier and Type | Method and Description |
---|---|
ij.ImageStack[] |
compute(boolean doIshow,
boolean hideLegend,
ij.ImagePlus imp)
Compute the Deconvolution images and return a Stack array of three 8-bit
images.
|
void |
computeAndShow(boolean doIshow,
boolean hideLegend,
ij.ImagePlus imp)
Compute the Deconvolution images and display them
|
double[] |
getMODx() |
double[] |
getMODy() |
double[] |
getMODz() |
void |
init(Roi[] rois,
ij.process.ImageProcessor ip,
String stainName) |
void |
init(String line) |
void |
init(String stainName,
double x0,
double y0,
double z0,
double x1,
double y1,
double z1,
double x2,
double y2,
double z2) |
void |
setMODx(double[] mODx) |
void |
setMODy(double[] mODy) |
void |
setMODz(double[] mODz) |
public void init(String line)
public void init(String stainName, double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2)
public double[] getMODx()
public void setMODx(double[] mODx)
public double[] getMODy()
public void setMODy(double[] mODy)
public double[] getMODz()
public void setMODz(double[] mODz)
public void computeAndShow(boolean doIshow, boolean hideLegend, ij.ImagePlus imp)
doIshow:
- Show or not the matrix in a popuphideLegend:
- Hide or not the legend in a popupimp
- : The ImagePlus that will be deconvolved. RGB only.public ij.ImageStack[] compute(boolean doIshow, boolean hideLegend, ij.ImagePlus imp)
doIshow:
- Show or not the matrix in a popuphideLegend:
- Hide or not the legend in a popupimp
- : The ImagePlus that will be deconvolved. RGB only.Copyright © 2015–2021 Fiji. All rights reserved.