Histopathology-Stain-Color-Normalization
Histopathology-Stain-Color-Normalization copied to clipboard
Issue reading the images.
Dear Farhad,
I'm having issues with your code when I try to read some .tif images from de Camelyon dataset. I get the following error:
Traceback (most recent call last):
File "Stain_Color_Normalization.py", line 116, in
I think that it might be something related to the PIL version or usage. Could you please let me know how you avoid this issue?
Thanks in advance, Fernando.
Hi Fernando,
The TIF file format of the Camelyon dataset cannot be read by the built-in python functions, such as "misc.imread". To do so, you need to use the OpenSlide library as described on the Camelyon website and forum.
Apart from this implementation issue, the released colour normalization code works with the image patches and not the Whole-Slide Images (WSIs). It is better you first extract some patches (this can be a very big piece of the image from each slides, and saved them as jpg or tif file) from the Camelyon data for training the colour normalization model.
I hope this answers your question.
Best, Farhad
On Fri, 7 Sep 2018 at 17:54, Fernando Pérez [email protected] wrote:
Dear Farhad,
I'm having issues with your code when I try to read some .tif images from de Camelyon dataset. I get the following error:
Traceback (most recent call last): File "Stain_Color_Normalization.py", line 116, in main() File "Stain_Color_Normalization.py", line 38, in main db = SampleProvider("Train_dataset", config.data_dir, config.fileformat, config.image_options, is_train) File "./StainNorm/Sample_Provider.py", line 18, in init self._read_images() File "./StainNorm/Sample_Provider.py", line 35, in _read_images self.images_org = np.array([misc.imread(filename) for filename in self.files]) File "./anaconda3/envs/PaStain27/lib/python2.7/site-packages/numpy/lib/utils.py", line 101, in newfunc return func(*args, **kwds) File "./anaconda3/envs/PaStain27/lib/python2.7/site-packages/scipy/misc/pilutil.py", line 164, in imread im = Image.open(name) File "./anaconda3/envs/PaStain27/lib/python2.7/site-packages/PIL/Image.py", line 2622, in open % (filename if filename else fp)) IOError: cannot identify image file './CAMELYON17/patient_015_node_0.tif'
I think that it might be something related to the PIL version or usage. Could you please let me know how you avoid this issue?
Thanks in advance, Fernando.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FarhadZanjani/Histopathology-Stain-Color-Normalization/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ5xaApksdUzD3iA-dhW6tOOn3Kb1Pn5ks5uYpbBgaJpZM4WfE4f .