-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2583 Add DatasetSummary #2616
2583 Add DatasetSummary #2616
Conversation
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
The initial implementation requires |
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Hi all, could you please help to review this PR? |
/build |
1 similar comment
/build |
I think this could be part of monai/data/utils.
|
Thanks @wyli . My question is that when the dataset has images in different spatial sizes, it cannot support |
the dataloader is implemented with a proper multiprocessing support, I think you can use it with batch_size=1 |
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Hi @wyli , thanks for the comments. The code may not be able to be in Now I've switched to use monai dataloader. Could you please help to re-review the code, thanks! |
Hi @ericspod , I've updated the code according to your comments, could you please help to re-review it, thanks! |
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
looks like a useful utility, I'd suggest changing its name to |
monai/data/dataset_calculator.py
Outdated
all_intensities.append(intensities) | ||
|
||
all_intensities = list(chain(*all_intensities)) | ||
self.data_min_percentile, self.data_max_percentile = np.percentile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're still accumulating all the foreground pixel values from all the images here, unless we have some way of doing an incremental percentile calculation we are stuck with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good with a few minor changes possibly.
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Hi @wyli , I've changed the name, and also add a test case for anisotropic spacings. |
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
…nv/MONAI into 2583-add-dataset-calculator
Perhaps in another iteration we can change the code to use some online histogram estimation such as https://github.com/maki-nage/distogram |
Mark: later I will update a tutorial in https://github.com/Project-MONAI/tutorials/tree/master/modules/dynunet_pipeline to show how can we get the spacings and normalization parameters. |
* Add DatasetCalculator Signed-off-by: Yiheng Wang <vennw@nvidia.com> * update docstring Signed-off-by: Yiheng Wang <vennw@nvidia.com> * use multiprocessing Signed-off-by: Yiheng Wang <vennw@nvidia.com> * update to use dataset and other places Signed-off-by: Yiheng Wang <vennw@nvidia.com> * update to support array return Signed-off-by: Yiheng Wang <vennw@nvidia.com> * update with new testcases and change name Signed-off-by: Yiheng Wang <vennw@nvidia.com> * update min test Signed-off-by: Yiheng Wang <vennw@nvidia.com> * update unittest Signed-off-by: Yiheng Wang <vennw@nvidia.com> * fix vstack error Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Signed-off-by: Yiheng Wang vennw@nvidia.com
Fixes #2583 .
Description
For 3D image segmentation tasks, users may not sure how to set a reasonable voxel spacing value, as well as the normalization parameters, this PR implements a class to address these issues.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests
.make html
command in thedocs/
folder.