Skip to content
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

Valve Landmark Bundle: Update to fix changes to EnsureChannelFirstd and further documentation #542

Merged
merged 8 commits into from
Jan 25, 2024
9 changes: 5 additions & 4 deletions models/valve_landmarks/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220729.json",
"version": "0.4.3",
"version": "0.5.0",
"changelog": {
"0.5.0": "Fix transform usage",
"0.4.3": "README.md fix",
"0.4.2": "add name tag",
"0.4.1": "modify dataset key name",
Expand All @@ -10,9 +11,9 @@
"0.2.0": "Unify naming",
"0.1.0": "Initial version"
},
"monai_version": "1.0.1",
"pytorch_version": "1.13.0",
"numpy_version": "1.21.2",
"monai_version": "1.3.0",
"pytorch_version": "2.1.1",
"numpy_version": "1.25.2",
"optional_packages_version": {},
"name": "Valve landmarks regression",
"task": "Given long axis MR images of the heart, identify valve insertion points through the full cardiac cycle",
Expand Down
6 changes: 4 additions & 2 deletions models/valve_landmarks/configs/train.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
},
{
"_target_": "EnsureChannelFirstd",
"keys": "@both_keys"
"keys": "@both_keys",
"channel_dim": "no_channel"
},
{
"_target_": "RandAxisFlipd",
Expand Down Expand Up @@ -166,7 +167,8 @@
},
{
"_target_": "EnsureChannelFirstd",
"keys": "@both_keys"
"keys": "@both_keys",
"channel_dim": "no_channel"
},
{
"_target_": "Lambdad",
Expand Down
11 changes: 10 additions & 1 deletion models/valve_landmarks/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Example plot of landmarks on a single frame, see [view_results.ipynb](./view_res

The training script `train.json` is provided to train the network using a dataset of image pairs containing the MR image and a landmark image. This is done to reuse image-based transforms which do not currently operate on geometry. A number of other transforms are provided in `valve_landmarks.py` to implement Fourier-space dropout, image shifting which preserve landmarks, and smooth-field deformation applied to images and landmarks.

The dataset used for training unfortunately cannot be made public, however the training script can be used with any NPZ file containing the training image stack in key `trainImgs` and landmark image stack in `trainLMImgs`, plus `testImgs` and `testLMImgs` containing validation data. The landmark images are defined as 0 for every non-landmark pixel, with landmark pixels contaning the following values for each landmark type:
The dataset used for training unfortunately cannot be made public, however the training script can be used with any NPZ file containing the training image stack in key `trainImgs` and landmark image stack in `trainLMImgs`, plus `testImgs` and `testLMImgs` containing validation data. The landmark images are defined as 0 for every non-landmark pixel, with landmark pixels containing the following values for each landmark type:

* 10: Mitral anterior in 2CH
* 15: Mitral posterior in 2CH
Expand All @@ -39,6 +39,15 @@ The dataset used for training unfortunately cannot be made public, however the t
* 200: Tricuspid septal
* 250: Tricuspid free wall

The MR and landmark images should be 2D with no channel dimension. Within the npz file these images should be stored in single large arrays with the batch dimension first. For example, the contents of the training dataset are:

* trainImgs (8574, 256, 256)
* testImgs (930, 256, 256)
* trainLMImgs (8574, 256, 256)
* testLMImgs (930, 256, 256)

This shows a training set of 8574 image pairs and a test set of 930 image pairs. The transforms provided with the bundle assume these dimensions so your own dataset should stick to this format.

The following command will train with the default NPZ filename `./valvelandmarks.npz`, assuming the current directory is the bundle directory:

```sh
Expand Down
Loading