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

test_tciadataset #6945

Closed
wyli opened this issue Sep 5, 2023 · 0 comments · Fixed by #6946
Closed

test_tciadataset #6945

wyli opened this issue Sep 5, 2023 · 0 comments · Fixed by #6946

Comments

@wyli
Copy link
Contributor

wyli commented Sep 5, 2023

[2023-09-05T13:22:13.399Z] ======================================================================
[2023-09-05T13:22:13.399Z] ERROR: test_values (tests.test_tciadataset.TestTciaDataset)
[2023-09-05T13:22:13.399Z] ----------------------------------------------------------------------
[2023-09-05T13:22:13.399Z] Traceback (most recent call last):
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/transform.py", line 141, in apply_transform
[2023-09-05T13:22:13.399Z]     return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/transform.py", line 98, in _apply_transform
[2023-09-05T13:22:13.399Z]     return transform(data, lazy=lazy) if isinstance(transform, LazyTrait) else transform(data)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/io/dictionary.py", line 164, in __call__
[2023-09-05T13:22:13.399Z]     data = self._loader(d[key], reader)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/io/array.py", line 290, in __call__
[2023-09-05T13:22:13.399Z]     img_array, meta_data = reader.get_data(img)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/data/image_reader.py", line 599, in get_data
[2023-09-05T13:22:13.399Z]     affine = self._get_affine(metadata, self.affine_lps_to_ras)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/data/image_reader.py", line 666, in _get_affine
[2023-09-05T13:22:13.399Z]     spacing = metadata["00280030"]["Value"]
[2023-09-05T13:22:13.399Z] KeyError: '00280030'
[2023-09-05T13:22:13.399Z] 
[2023-09-05T13:22:13.399Z] The above exception was the direct cause of the following exception:
[2023-09-05T13:22:13.399Z] 
[2023-09-05T13:22:13.399Z] Traceback (most recent call last):
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/transform.py", line 141, in apply_transform
[2023-09-05T13:22:13.399Z]     return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/transform.py", line 98, in _apply_transform
[2023-09-05T13:22:13.399Z]     return transform(data, lazy=lazy) if isinstance(transform, LazyTrait) else transform(data)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/compose.py", line 335, in __call__
[2023-09-05T13:22:13.399Z]     result = execute_compose(
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/compose.py", line 111, in execute_compose
[2023-09-05T13:22:13.399Z]     data = apply_transform(
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/transform.py", line 171, in apply_transform
[2023-09-05T13:22:13.399Z]     raise RuntimeError(f"applying transform {transform}") from e
[2023-09-05T13:22:13.399Z] RuntimeError: applying transform <monai.transforms.io.dictionary.LoadImaged object at 0x7f449a92b5e0>
[2023-09-05T13:22:13.399Z] 
[2023-09-05T13:22:13.399Z] The above exception was the direct cause of the following exception:
[2023-09-05T13:22:13.399Z] 
[2023-09-05T13:22:13.399Z] Traceback (most recent call last):
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/tests/test_tciadataset.py", line 61, in test_values
[2023-09-05T13:22:13.399Z]     _test_dataset(data)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/tests/test_tciadataset.py", line 43, in _test_dataset
[2023-09-05T13:22:13.399Z]     self.assertTrue("image" in dataset[0])
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/data/dataset.py", line 112, in __getitem__
[2023-09-05T13:22:13.399Z]     return self._transform(index)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/data/dataset.py", line 910, in _transform
[2023-09-05T13:22:13.399Z]     return super()._transform(index)
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/data/dataset.py", line 98, in _transform
[2023-09-05T13:22:13.399Z]     return apply_transform(self.transform, data_i) if self.transform is not None else data_i
[2023-09-05T13:22:13.399Z]   File "/home/jenkins/agent/workspace/MONAI-postmerge/monai_github/monai/transforms/transform.py", line 171, in apply_transform
[2023-09-05T13:22:13.399Z]     raise RuntimeError(f"applying transform {transform}") from e
[2023-09-05T13:22:13.399Z] RuntimeError: applying transform <monai.transforms.compose.Compose object at 0x7f449a90de20>
[2023-09-05T13:22:13.399Z] 
[2023-09-05T13:22:13.399Z] ----------------------------------------------------------------------
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Sep 5, 2023
Signed-off-by: KumoLiu <[email protected]>
@wyli wyli closed this as completed in #6946 Sep 5, 2023
wyli pushed a commit that referenced this issue Sep 5, 2023
Fixes #6945 .

### Description
Try get "00280030" (PixelSpacing) first.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

Signed-off-by: KumoLiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant