Closed Mnkach closed 4 years ago
Thank you for the detailed bug report, @Mnkach! Are you able to share Snap-450.png
as well?
I attached it to the header.
/cc @spotter
In line 595 of Colour_Deconvolution.java
, there seems to be an offset calculation that is not present in our implementation. Could that be the cause?
double output = Math.exp(-((Rscaled + Gscaled + Bscaled) - 255.0) * log255 / 255.0);
if(output>255) output=255;
newpixels[i][j]=(byte)(0xff&(int)(Math.floor(output+.5)));
}
}
// add new values to output images
outputstack[0].addSlice(label,newpixels[0]);
outputstack[1].addSlice(label,newpixels[1]);
outputstack[2].addSlice(label,newpixels[2]);
I also don't think the visualization method used here is the same as in the code, so the colors will be different.
Is this function operating correctly? I also get only negative values.
Hey @asmagen, thank you for letting us know. Could you give us an example? Some code running would be great to investigate. Thanks again!
Thank you @Mnkach!
Description
The transformed images of ImageJ color deconvolution plugin and skimage.color.separate_stains() are not the same, while transformation matrices are the same. In my case, after separate_stains(img, bex_from_rgb) eosin channel looks like inverted to ImageJ and all the output values are negative.
The following lines
outputs
So how to correctly convert values after transformation to uint8?
Way to reproduce
Version information
UPD Snap-450.png