Skip to content

Updated the mednist notebooks adding the dependencies of pydicom and highdicom #435

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

Merged
merged 7 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def compute(self, op_input: InputContext, op_output: OutputContext, context: Exe


@md.resource(cpu=1, gpu=1, memory="1Gi")
@md.env(pip_packages=["pydicom >= 2.3.0", "highdicom>=0.18.2", "typeguard~=2.12.1"])
class App(Application):
"""Application class for the MedNIST classifier."""

Expand Down
6 changes: 6 additions & 0 deletions examples/apps/simple_imaging_app/gaussian_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ class GaussianOperator(Operator):
"""

def compute(self, op_input: InputContext, op_output: OutputContext, context: ExecutionContext):
import numpy as np
from skimage.filters import gaussian
from skimage.io import imsave

data_in = op_input.get().asnumpy()
data_out = gaussian(data_in, sigma=0.2, channel_axis=2) # Add the param introduced in 0.19.

# Make sure the data type is what PIL Image can support, as the imsave function calls PIL Image fromarray()
# Some details can be found at https://stackoverflow.com/questions/55319949/pil-typeerror-cannot-handle-this-data-type
if np.max(data_out) <= 1:
data_out = (data_out * 255).astype(np.uint8)

output_folder = op_output.get().path
output_path = output_folder / "final_output.png"
imsave(output_path, data_out)
267 changes: 161 additions & 106 deletions notebooks/tutorials/01_simple_app.ipynb

Large diffs are not rendered by default.

2,153 changes: 2,068 additions & 85 deletions notebooks/tutorials/02_mednist_app-prebuilt.ipynb

Large diffs are not rendered by default.

1,694 changes: 1,639 additions & 55 deletions notebooks/tutorials/02_mednist_app.ipynb

Large diffs are not rendered by default.

1,158 changes: 657 additions & 501 deletions notebooks/tutorials/03_segmentation_app.ipynb

Large diffs are not rendered by default.

799 changes: 427 additions & 372 deletions notebooks/tutorials/03_segmentation_viz_app.ipynb

Large diffs are not rendered by default.

823 changes: 174 additions & 649 deletions notebooks/tutorials/06_monai_bundle_app.ipynb

Large diffs are not rendered by default.

2,086 changes: 1,253 additions & 833 deletions notebooks/tutorials/07_multi_model_app.ipynb

Large diffs are not rendered by default.