fepegar / torchio

Compare e59e2c5 ... +0 ... 7d4e6f8

Coverage Reach
torchio/transforms/augmentation/intensity/random_labels_to_image.py torchio/transforms/augmentation/intensity/random_motion.py torchio/transforms/augmentation/intensity/random_ghosting.py torchio/transforms/augmentation/intensity/random_swap.py torchio/transforms/augmentation/intensity/random_bias_field.py torchio/transforms/augmentation/intensity/random_spike.py torchio/transforms/augmentation/intensity/random_gamma.py torchio/transforms/augmentation/intensity/random_blur.py torchio/transforms/augmentation/intensity/random_noise.py torchio/transforms/augmentation/intensity/__init__.py torchio/transforms/augmentation/spatial/random_affine.py torchio/transforms/augmentation/spatial/random_elastic_deformation.py torchio/transforms/augmentation/spatial/random_flip.py torchio/transforms/augmentation/spatial/random_anisotropy.py torchio/transforms/augmentation/spatial/__init__.py torchio/transforms/augmentation/composition.py torchio/transforms/augmentation/random_transform.py torchio/transforms/augmentation/__init__.py torchio/transforms/preprocessing/spatial/resample.py torchio/transforms/preprocessing/spatial/crop_or_pad.py torchio/transforms/preprocessing/spatial/pad.py torchio/transforms/preprocessing/spatial/crop.py torchio/transforms/preprocessing/spatial/ensure_shape_multiple.py torchio/transforms/preprocessing/spatial/to_canonical.py torchio/transforms/preprocessing/spatial/bounds_transform.py torchio/transforms/preprocessing/intensity/histogram_standardization.py torchio/transforms/preprocessing/intensity/rescale.py torchio/transforms/preprocessing/intensity/z_normalization.py torchio/transforms/preprocessing/intensity/normalization_transform.py torchio/transforms/preprocessing/intensity/__init__.py torchio/transforms/preprocessing/label/remap_labels.py torchio/transforms/preprocessing/label/one_hot.py torchio/transforms/preprocessing/label/sequential_labels.py torchio/transforms/preprocessing/label/keep_largest_component.py torchio/transforms/preprocessing/label/remove_labels.py torchio/transforms/preprocessing/label/contour.py torchio/transforms/preprocessing/label/label_transform.py torchio/transforms/preprocessing/__init__.py torchio/transforms/transform.py torchio/transforms/data_parser.py torchio/transforms/__init__.py torchio/transforms/lambda_transform.py torchio/transforms/interpolation.py torchio/transforms/intensity_transform.py torchio/transforms/fourier.py torchio/transforms/spatial_transform.py torchio/data/image.py torchio/data/io.py torchio/data/sampler/weighted.py torchio/data/sampler/label.py torchio/data/sampler/sampler.py torchio/data/sampler/uniform.py torchio/data/sampler/__init__.py torchio/data/inference/aggregator.py torchio/data/inference/grid_sampler.py torchio/data/inference/__init__.py torchio/data/subject.py torchio/data/queue.py torchio/data/dataset.py torchio/data/__init__.py torchio/datasets/mni/icbm.py torchio/datasets/mni/colin.py torchio/datasets/mni/pediatric.py torchio/datasets/mni/sheep.py torchio/datasets/mni/__init__.py torchio/datasets/mni/mni.py torchio/datasets/ixi.py torchio/datasets/episurg.py torchio/datasets/bite.py torchio/datasets/itk_snap/itk_snap.py torchio/datasets/itk_snap/__init__.py torchio/datasets/fpg.py torchio/datasets/slicer.py torchio/datasets/__init__.py torchio/utils.py torchio/visualization.py torchio/download.py torchio/cli/apply_transform.py torchio/cli/print_info.py torchio/typing.py torchio/constants.py torchio/__init__.py torchio/reference.py tests/transforms/augmentation/test_random_labels_to_image.py tests/transforms/augmentation/test_random_affine.py tests/transforms/augmentation/test_random_ghosting.py tests/transforms/augmentation/test_random_elastic_deformation.py tests/transforms/augmentation/test_random_motion.py tests/transforms/augmentation/test_random_spike.py tests/transforms/augmentation/test_random_gamma.py tests/transforms/augmentation/test_random_noise.py tests/transforms/augmentation/test_random_blur.py tests/transforms/augmentation/test_random_anisotropy.py tests/transforms/augmentation/test_random_flip.py tests/transforms/augmentation/test_random_bias_field.py tests/transforms/augmentation/test_oneof.py tests/transforms/augmentation/test_random_swap.py tests/transforms/preprocessing/test_crop_pad.py tests/transforms/preprocessing/test_rescale.py tests/transforms/preprocessing/test_resample.py tests/transforms/preprocessing/test_histogram_standardization.py tests/transforms/preprocessing/test_ensure_shape_multiple.py tests/transforms/preprocessing/test_pad.py tests/transforms/preprocessing/test_z_normalization.py tests/transforms/preprocessing/test_to_canonical.py tests/transforms/preprocessing/test_crop.py tests/transforms/test_transforms.py tests/transforms/test_invertibility.py tests/transforms/label/test_remove_labels.py tests/transforms/label/test_sequential_labels.py tests/transforms/label/test_remap_labels.py tests/transforms/test_lambda_transform.py tests/transforms/test_collate.py tests/transforms/test_reproducibility.py tests/data/test_image.py tests/data/test_io.py tests/data/sampler/test_label_sampler.py tests/data/sampler/test_weighted_sampler.py tests/data/sampler/test_uniform_sampler.py tests/data/sampler/test_patch_sampler.py tests/data/sampler/test_random_sampler.py tests/data/inference/test_aggregator.py tests/data/inference/test_grid_sampler.py tests/data/inference/test_inference.py tests/data/test_subject.py tests/data/test_subjects_dataset.py tests/data/test_queue.py tests/utils.py tests/test_utils.py tests/test_cli.py tests/datasets/test_ixi.py print_system.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -17,8 +17,13 @@
Loading
17 17
18 18
    def apply_transform(self, subject):
19 19
        for image in self.get_images(subject):
20 -
            assert image.data.ndim == 4 and image.data.shape[0] == 1
21 -
            data = image.data.squeeze()
20 +
            if image.num_channels > 1:
21 +
                message = (
22 +
                    'The number of input channels must be 1,'
23 +
                    f' but it is {image.num_channels}'
24 +
                )
25 +
                raise RuntimeError(message)
26 +
            data = image.data[0]
22 27
            num_classes = -1 if self.num_classes is None else self.num_classes
23 28
            one_hot = F.one_hot(data.long(), num_classes=num_classes)
24 29
            image.set_data(one_hot.permute(3, 0, 1, 2).type(data.type()))

@@ -274,6 +274,11 @@
Loading
274 274
        point_fin = nib.affines.apply_affine(self.affine, fin)
275 275
        return np.array((point_ini, point_fin))
276 276
277 +
    @property
278 +
    def num_channels(self) -> int:
279 +
        """Get the number of channels in the associated 4D tensor."""
280 +
        return len(self.data)
281 +
277 282
    def axis_name_to_index(self, axis: str) -> int:
278 283
        """Convert an axis name to an axis index.
279 284

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
tests 99.76%
torchio -0.05% 86.57%
print_system.py 0.00%
Project Totals (132 files) 90.55%
Loading