Skip to content

Commit

Permalink
Fixes #1 - using costes au threshold keeps the ROI selection
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoKiaru committed Apr 23, 2024
1 parent 1812bbf commit ffb26e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ch/epfl/biop/coloc/JACoP_B.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private void runColoc() {
// Because initializing the colocalizer writes a result already,
// We need to remove this ghost value
ic.removeLastRow();
} // END CONDITION IS STACK Z for getting threhsolds
} // END CONDITION IS STACK Z for getting thresholds


// The resulting image will be RGB and potentially a stack of T and Z
Expand Down
24 changes: 17 additions & 7 deletions src/main/java/ch/epfl/biop/coloc/utils/ImageColocalizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class ImageColocalizer {
private Plot fluorogram_plot, icq_plot, costes_plot, cff_plot;

// OB: Add output for Costes Mask
private ImagePlus costesMask;
//private ImagePlus costesMask;
private Plot ica_a_plot;
private Plot ica_b_plot;
private ImagePlus costes_rand;
Expand Down Expand Up @@ -479,7 +479,7 @@ public void CostesAutoThr() {
//plot.show();

// OB: Created local variable to be able to request the image as needed.
costesMask=NewImage.createRGBImage("Costes' mask",this.width,this.height,this.nbSlices,0);
ImagePlus costesMask=NewImage.createRGBImage("Costes' mask",this.width,this.height,this.nbSlices,0);
costesMask.getProcessor().setValue(Math.pow(2, this.depth));
for (int k=1; k<=this.nbSlices; k++){
costesMask.setSlice(k);
Expand Down Expand Up @@ -521,8 +521,9 @@ public void CostesAutoThr() {
// Seeing as it was set, set the thresholds here
this.thrA = CostesThrA;
this.thrB = CostesThrB;



setThresholds(thrA, thrB);

}

public void CCF(int CCFx){
Expand Down Expand Up @@ -1629,9 +1630,9 @@ public Plot getCFFPlot() {
return cff_plot;
}

public ImagePlus getCostesMask() {
/*public ImagePlus getCostesMask() {
return costesMask;
}
}*/

public Plot getICAaPlot() {
return ica_a_plot;
Expand Down Expand Up @@ -1665,9 +1666,18 @@ public void setThresholds(int thrA, int thrB) {

this.thrA = thrA;
this.thrB = thrB;

if(roi!=null) {
for(int i=0; i<impA.getStackSize(); i++) {
impA.getStack().getProcessor(i+1).setMask(mask);
impB.getStack().getProcessor(i+1).setMask(mask);
}
impA.setRoi(roi);
impB.setRoi(roi);
}

impA.getProcessor().setThreshold(this.thrA , impA.getProcessor().getMaxThreshold(), ImageProcessor.NO_LUT_UPDATE);
impB.getProcessor().setThreshold(this.thrB , impB.getProcessor().getMaxThreshold(), ImageProcessor.NO_LUT_UPDATE);

}

public int getThresholdA() {
Expand Down

0 comments on commit ffb26e5

Please sign in to comment.