Comments (4)
Hi Mart,
Great, there is options already! I'll try those. I think I should manage with the information provided. Good to hear that you're working on documentation. I'll let you know if I have any further issues or questions.
Thanks,
Michel
from pathology-whole-slide-data.
Dear Michel,
In the batch iterator, you can use any albumentations augmentation. This augmentation callback was implemented by @thijsgelton via batch callbacks. Here is an example config file that includes the configuration and shows how you can use callbacks and in specific the albumentations callback: https://github.com/DIAGNijmegen/pathology-whole-slide-data/blob/main/tests/test_files/user_config.yml
You can also create a Batch or Sample callback and use custom data augmentations. For example, you can subclass SampleCallback and use your own subclass. All patches and labels will be passed through if you add your callback in your config file.
You can use random angle rotation in a custom SampleCallback and crop via the FitOutput sample callback. Please note that this is a sample callback, so the rotation should also be a sample callback and should be specified before the cropping callback. There is no batch cropping callback, but I will implement that soon.
For training HookNet, we used spatial, color, noise, and stain augmentations. Due to low-resolution and high-resolution patches, you will have to be careful in applying distortive augmentations because the effect will be more severe in the low-resolution patch and, therefore can misalign the patches.
I am working on documentation, but this is not done yet, so please let me know if anything is unclear.
Best wishes,
Mart
from pathology-whole-slide-data.
Dear Michel,
In the batch iterator, you can use any albumentations augmentation. This augmentation callback was implemented by @thijsgelton via batch callbacks. Here is an example config file that includes the configuration and shows how you can use callbacks and in specific the albumentations callback: https://github.com/DIAGNijmegen/pathology-whole-slide-data/blob/main/tests/test_files/user_config.yml
You can also create a Batch or Sample callback and use custom data augmentations. For example, you can subclass SampleCallback and use your own subclass. All patches and labels will be passed through if you add your callback in your config file.
You can use random angle rotation in a custom SampleCallback and crop via the FitOutput sample callback. Please note that this is a sample callback, so the rotation should also be a sample callback and should be specified before the cropping callback. There is no batch cropping callback, but I will implement that soon.
For training HookNet, we used spatial, color, noise, and stain augmentations. Due to low-resolution and high-resolution patches, you will have to be careful in applying distortive augmentations because the effect will be more severe in the low-resolution patch and, therefore can misalign the patches.
I am working on documentation, but this is not done yet, so please let me know if anything is unclear.
Best wishes, Mart
Hi Mart,
I'm also in the process of applying augmentation technique. The usr_config you shared in this reply can not be found anymore. Would it be possible that you could share a new one? Thanks!
from pathology-whole-slide-data.
Dear @yuling-luo
You can add something like this to your user config:
batch_callbacks:
- "*object": wholeslidedata.interoperability.albumentations.callbacks.AlbumentationsSegmentationBatchCallback
augmentations:
- RandomRotate90:
p: 0.5
- Flip:
p: 0.5
- RandomSizedCrop:
p: 1
min_max_height: [ 100, 200 ]
height: 284
width: 284
- ElasticTransform:
p: 0.5
alpha: 45
sigma: 6
alpha_affine: 4
- HueSaturationValue:
hue_shift_limit: 0.2
sat_shift_limit: 0.3
val_shift_limit: 0.2
p: 0.5
- GridDistortion:
p: 1.0
- RandomBrightnessContrast:
p: 0.4
Please note that you will need albumentations==1.2.1, newer version of albumentations wont work (will have to update the callback to make it compatible with newer versions.)
Let me know if you have any trouble
from pathology-whole-slide-data.
Related Issues (20)
- create_batch_iterator that associates files with exact matching HOT 3
- write docs HOT 1
- changing image backend to pyvips HOT 4
- Sliding window with Segmentation Mask Sampling HOT 9
- read images and annotation directly from s3 bucket HOT 9
- Iterating over classes in WholeSlideAnnotation objects HOT 2
- Tissue masking HOT 7
- plot_annotations plots everything flipped HOT 1
- AsapAnnotationParser label colors from group HOT 1
- Sliding Window configuration HOT 6
- Strict sampling with `point_sampler` fails when using data with different level 0 spacings HOT 2
- I got confused between branch 'main' and '0.0.16' HOT 1
- Installing package on local machine HOT 3
- Advantage of ConcurrentBuffer against standard pytorch data loader HOT 2
- create_batch_iterator fails when copy_path != None and number_of_batches > 0 HOT 2
- from wholeslidedata.source.configuration.config import insert_paths_into_config HOT 2
- QuPath annotations (.geojson) format not readable by parser HOT 1
- Implement annotation offset for offset bounds in mrxs files HOT 1
- Patch label sampler fails with point annotation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathology-whole-slide-data.