Closed maduc7 closed 1 year ago
Okay I found a solution. If anyone is facing the same issue I did the following for each slide:
When creating the patches in create_patches_fp.py
:
dataset_h5.py
:
- if level 1 is 2 take level 1, if level 1 is 4
Could you please explain this sentence a little bit more? What do you mean by "level 1 is 2", and "level 1 is 4"?
Thank you
For each level in the pyramid you have an associated downsample level.
This associated downsample level can be found in the class WholeSlideImage.py
: self.level_downsamples = self._assertLevelDownsamples()
For the level 1 you can access it via: level_downsamples[1][0] and check whether this is equal to 2 or 4. Meaning whether the slides at level 1 has been downsampled by 2 or by 4.
Hope this makes more sense
Maybe you have noticed that there are parameters called "custom_downsample" and "target_patch_size" in extract_features_fp.py? You can change either one if you need.
How can I get the original magnification?I don't know TCGA-BRCA is at 40x or 20x.
When you open a slide with openslide, some properties are also loaded and one of them is the magnification:
wsi = openslide.open_slide(path_to_wsi)
magnification = wsi.properties["openslide.objective-power"]
some slides in TCGA don't have magnification information as follows:
Hi, I found two related issues about my question: #147 and #162 but I did not understand how to do it.
I want all my slides at the magnification at 20x. I have some slides at 40x magnification. One solution is to take the level 1 when it is 2 but for most of them it is 4. This would lead to 10x instead of 20x. As far as I understood the solution would be to downsample the level 0 by 2 but I could not figure out how to do that using create_patches_fp.py. I found it in create_patches.py but this method takes way too much memory and somehow the custom_downsample parameter was removed.
Thanks