From f61406e38c5683da46c30232f4becfe225e40da9 Mon Sep 17 00:00:00 2001 From: iback Date: Fri, 21 Aug 2026 06:31:13 +0000 Subject: [PATCH 1/2] refactor: the registry builds the pipelines; delete the four if ladders smauglab/transforms/build.py does the dispatch once, for all three GPU pipeline modes and for the CPU one. The ladders it replaces go: gpu/transforms.py 714 -> 31 lines gpu/transforms_list.py 974 -> 117 lines (two ladders in one file) cpu/transforms.py 412 -> 80 lines Which class a config key maps to, which parameters it accepts, and where it sits in the pipeline all come from the registry now, so the four copies cannot drift again. The temporary aliases the previous commits left in contrast.py go with them. Configs move to the sectioned, class-name-keyed format in the same commit, because the ladders and the old key names are the same thing. All 29 shipped configs were rewritten by migration/migrate.py rather than by hand; the originals are kept verbatim as unit_tests/fixtures/legacy_configs/ so the migrator has something to be tested against. That this changed nothing is checked, not asserted. unit_tests/fixtures/legacy_effective_kwargs.json records the class and effective constructor kwargs of every transform the ladders built, for every config and both GPU modes, captured from the commit before they were deleted by instrumenting each __init__. unit_tests/test_builder.py rebuilds each of those pipelines through the registry and compares. All 27 match. Three differences are normalised away, and the test says why: the ladders built one class parameterised by kernel_type/func/invert_image where the builder builds the leaf; that shared class therefore bound kernel-specific parameters its leaves do not declare (a Scharr transform carried `sigma`, which only the blur reads); and p_batch is new and defaults to kornia's own 1.0 either way. The remaining 21 of the 48 pipelines could not be compared because the ladder crashed on them: AugTransformsGPURandomOrder did config.get("RandomChooseXTransforms").get(...), which is an AttributeError for every config that omits that block -- 21 of 29. They build now. That is a fix, not a regression, but it does mean those configs have no "before" to check against. pipeline.order is wired through build_transforms: registry order by default, config key order when a config asks for it. .gitignore's repo-wide *.json would have swallowed the fixtures and the migration table, so each gets an explicit un-ignore. Co-Authored-By: Claude Opus 5 --- .gitignore | 5 + migration/README.md | 29 + migration/migrate.py | 471 + smauglab/configs/transform_params.json | 238 +- smauglab/configs/transform_params_gpu.json | 483 +- smauglab/configs/transform_params_hybrid.json | 452 +- .../configs/transform_params_hybrid_TAGE.json | 461 +- ...rams_one-sequence-to-segment-them-all.json | 389 +- smauglab/transforms/build.py | 173 + smauglab/transforms/cpu/contrast.py | 6 - smauglab/transforms/cpu/transforms.py | 320 +- smauglab/transforms/gpu/contrast.py | 12 - smauglab/transforms/gpu/transforms.py | 522 +- smauglab/transforms/gpu/transforms_list.py | 700 +- .../configs/synthseg_params.json | 50 + .../configs/transform_params.json | 98 + .../configs/transform_params_gpu.json | 209 + ...sform_params_gpu_basedon3d250af0-noGE.json | 165 + ...pu_basedon3d250af0-noTA-heavyFunction.json | 165 + ...arams_gpu_basedon3d250af0-noTA-nobias.json | 165 + ...sform_params_gpu_basedon3d250af0-noTA.json | 165 + .../transform_params_gpu_basedon3d250af0.json | 165 + ...orm_params_gpu_default01-23-List-TA05.json | 171 + ...orm_params_gpu_default01-23-List-TA08.json | 169 + ...ransform_params_gpu_default01-23-List.json | 169 + ...nsform_params_gpu_default01-23-Scharr.json | 108 + ...ansform_params_gpu_default01-23-focus.json | 165 + ...ransform_params_gpu_default01-23-noGE.json | 96 + ...ms_gpu_default01-23-noMirror-RandConv.json | 165 + ...form_params_gpu_default01-23-noMirror.json | 165 + ...ransform_params_gpu_default01-23-noTA.json | 98 + .../transform_params_gpu_default01-23.json | 165 + ...params_gpu_default01-23_CropTransform.json | 171 + ...orm_params_gpu_default01-23_ICGT_plus.json | 170 + ...efault01-23_ImageContrastGPUTransform.json | 170 + ..._default01-23_RandomDomainTransferGPU.json | 180 + ...form_params_gpu_default01-23_Synthseg.json | 213 + ..._params_gpu_default01-23_SynthsegPlus.json | 213 + .../transform_params_gpu_inoutseg.json | 155 + .../transform_params_gpu_palette-em.json | 232 + .../configs/transform_params_hybrid.json | 262 + .../configs/transform_params_hybrid_TAGE.json | 264 + ...rams_one-sequence-to-segment-them-all.json | 165 + .../fixtures/legacy_effective_kwargs.json | 9889 +++++++++++++++++ unit_tests/test_builder.py | 229 + unit_tests/test_kernel_correctness.py | 6 +- 46 files changed, 16925 insertions(+), 2308 deletions(-) create mode 100644 migration/README.md create mode 100644 migration/migrate.py create mode 100644 smauglab/transforms/build.py create mode 100644 unit_tests/fixtures/legacy_configs/configs/synthseg_params.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noGE.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-heavyFunction.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-nobias.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA05.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA08.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List.json create mode 100755 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-Scharr.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-focus.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noGE.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror-RandConv.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noTA.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_CropTransform.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ICGT_plus.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ImageContrastGPUTransform.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_RandomDomainTransferGPU.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_Synthseg.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_SynthsegPlus.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_inoutseg.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_palette-em.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid.json create mode 100644 unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid_TAGE.json create mode 100755 unit_tests/fixtures/legacy_configs/configs/transform_params_one-sequence-to-segment-them-all.json create mode 100644 unit_tests/fixtures/legacy_effective_kwargs.json create mode 100644 unit_tests/test_builder.py diff --git a/.gitignore b/.gitignore index 60f1785..83fbfeb 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,11 @@ share/python-wheels/ *.egg MANIFEST *.json +# ...but these are source, not per-experiment output. The blanket *.json above was +# added to keep local sweep configs out (7ff2088); it would otherwise swallow the +# migration table, the test fixtures and the migrator itself. +!unit_tests/fixtures/**/*.json +!migration/*.json *.yaml *.nii *.nii.gz diff --git a/migration/README.md b/migration/README.md new file mode 100644 index 0000000..2e0f309 --- /dev/null +++ b/migration/README.md @@ -0,0 +1,29 @@ +# docs + +## `hash_migration.json` + +`segtransferaug/run_trainings.py` names each experiment directory + + Dataset{id}-{trainer}-aug-{transform_hash}-c-{config_hash} + +where `config_hash` is a sha256 over the canonical JSON of the config and +`transform_hash` is a sha256 over the text of `smauglab/transforms/gpu/transforms.py`. + +The registry migration moved both: every config was rewritten to class-name keys, and +the GPU builder that file contained was replaced by a registry-driven one. Runs made +before the migration keep their old directory names, so anything that looks a run up +by hash needs this table. The canonicalisation itself is unchanged and is asserted +byte-for-byte against the original implementation, so a config that did not change +would still hash the same. + +Two old hashes map to configs that are now byte-identical: + +* `0b639cf1` covered `transform_params_gpu_default01-23.json` and + `transform_params_one-sequence-to-segment-them-all.json`, which had the same content + all along under different names. +* `transform_params_gpu_default01-23_ICGT_plus.json` had its own hash only because of + the dead `ImageContrastGPUTransform` block; with that gone it is a duplicate of + `default01-23`. + +Known consumer, updated to accept both: `segtransferaug/refinement/config.py`, whose +`DOMAIN_TRANSFER_HASHES` selects the fusion source pool. diff --git a/migration/migrate.py b/migration/migrate.py new file mode 100644 index 0000000..bda700a --- /dev/null +++ b/migration/migrate.py @@ -0,0 +1,471 @@ +"""Rewrite a pre-registry config into the current format. + +Config keys used to be loosely-related labels: `ScharrTransform` built a +`RandomConvTransformGPU(kernel_type="Scharr")`, `SynthSeg` built a +`RandomSynthSegGPU`, and `nnUNetSpatialTransform` built nothing at all in the GPU +pipeline. A key is now the class name, exactly, and a parameter is a constructor +argument, exactly. + +Nothing here is consulted when *loading* a config -- old spellings do not work, by +design. This module exists only to rewrite files, so that configs sitting in old +experiment output folders can be brought forward instead of silently rotting. A +test asserts that no legacy key in `LEGACY_KEYS` resolves through the registry. + +Usage: + smauglab migrate OLD.json -o NEW.json + smauglab migrate --check smauglab/configs/*.json +""" + +from __future__ import annotations + +import argparse +import copy +import json +import sys +from pathlib import Path +from typing import Any + +from smauglab import registry +from smauglab.registry import Backend + +# --- key mapping ----------------------------------------------------------------- + +#: Legacy GPU config key -> current class name. +LEGACY_GPU_KEYS: dict[str, str] = { + "FlipTransform": "RandomFlipTransformGPU", + "AffineTransform": "RandomAffineGPU", + "SynthSeg": "RandomSynthSegGPU", + "RandomPALETTETransform": "RandomPaletteGPU", + # The class was renamed twice before the registry existed; both spellings appear + # in configs_paul and both mean what is now RandomPaletteGPU. + "ImageContrastV26_6_2GPUTransform": "RandomPaletteGPU", + "RandomDomainTransferGPU": "RandomDomainTransferGPU", + "DomainTransferTransform": "RandomDomainTransferGPU", + "InverseTransform": "RandomInverseGPU", + "HistogramEqualizationTransform": "RandomHistogramEqualizationGPU", + "RedistributeSegTransform": "RandomRedistributeSegGPU", + "ScharrTransform": "RandomScharrGPU", + "UnsharpMaskTransform": "RandomUnsharpMaskGPU", + "RandomConvTransform": "RandomRandConvGPU", + "ClampTransform": "RandomClampGPU", + "GaussianNoiseTransform": "RandomGaussianNoiseGPU", + "GaussianBlurTransform": "RandomGaussianBlurGPU", + "BrightnessTransform": "RandomBrightnessGPU", + "GammaTransform": "RandomGammaGPU", + "InvGammaTransform": "RandomInvGammaGPU", + "ContrastTransform": "RandomContrastGPU", + "SimulateLowResTransform": "RandomLowResTransformGPU", + "AcqTransform": "RandomAcqTransformGPU", + "CropTransform": "RandomCropTransformGPU", + "BiasFieldTransform": "RandomBiasFieldGPU", + "ZscoreNormalizationTransform": "ZscoreNormalizationGPU", +} + +#: Legacy CPU config key -> current class name. Most already matched their class. +LEGACY_CPU_KEYS: dict[str, str] = { + "HistogramEqualTransform": "HistogramEqualTransform", + "RedistributeTransform": "RedistributeTransform", + "ShapeTransform": "ShapeTransform", + "ArtifactTransform": "ArtifactTransform", + "SpatialCustomTransform": "SpatialCustomTransform", + "SpatialTransform": "SpatialTransform", + "GaussianNoiseTransform": "GaussianNoiseTransform", + "GaussianBlurTransform": "GaussianBlurTransform", + "MultiplicativeBrightnessTransform": "MultiplicativeBrightnessTransform", + "ContrastTransform": "ContrastTransform", + "SimulateLowResolutionTransform": "SimulateLowResolutionTransform", + "GammaTransform": "GammaTransform", + "GammaTransform_invert": "InvertedGammaTransform", +} + +#: `FunctionTransform` was one key that the builder fanned out over a hardcoded +#: lambda list, so it becomes five blocks -- one per function, in ladder order. +FUNCTION_LEAVES = { + Backend.GPU: ["RandomLog1pGPU", "RandomSqrtGPU", "RandomSinGPU", "RandomExpGPU", "RandomSigmoidGPU"], + Backend.CPU: ["Log1pTransform", "SqrtTransform", "SinTransform", "ExpTransform", "SigmoidTransform"], +} + +#: `ConvTransform` carried its kernel in a parameter; the kernel now picks the class. +CPU_CONV_BY_KERNEL = {"Laplace": "LaplaceConvTransform", "Scharr": "ScharrConvTransform"} + +#: Which config parameters the old builder actually forwarded, per legacy key. +#: +#: Anything a config set outside these sets was silently discarded -- the builder +#: simply never read it, and `**kwargs` swallowed the rest. Carrying such a value +#: forward would *activate* a setting that has never had any effect, so the migrator +#: drops it and says so. `transform_params_gpu_inoutseg.json` really does set +#: `mix_prob` on `GaussianBlurTransform`, which the builder never passed on. +#: +#: Derived mechanically from `_build_transforms` while it still existed. +FORWARDED_GPU_PARAMS: dict[str, set[str]] = { + "FlipTransform": {"flip_axis", "keepdim", "probability", "same_on_batch"}, + "AffineTransform": {"degrees", "probability", "resample", "scale", "shear", "translate"}, + "SynthSeg": {"probability"}, + "RandomPALETTETransform": { + "alpha_magnitude_range", + "blur_sigmas", + "c_choices", + "dark_threshold", + "label_classes", + "label_remap_prob", + "min_label_voxels", + "n_kmeans_subsample", + "probability", + "s_choices", + "skip_parcellation_prob", + "skip_sub_parc_prob", + }, + "RandomDomainTransferGPU": { + "any_source", + "apply_to_channel", + "bank_path", + "bias_field_std", + "bias_scale", + "blend_concentration", + "blend_targets", + "include_self", + "p_class_mix", + "p_spatial_mix", + "pct", + "probability", + "same_on_batch", + "sigma", + "source_label", + "spatial_mix_gain", + "spatial_mix_scale", + "targets", + "zscore_io", + }, + "InverseTransform": {"in_seg", "mix_in_out", "mix_prob", "out_seg", "probability", "retain_stats"}, + "HistogramEqualizationTransform": {"in_seg", "mix_in_out", "mix_prob", "out_seg", "probability", "retain_stats"}, + "RedistributeSegTransform": {"dilation_iterations_range", "in_seg", "probability", "retain_stats", "std_noise_range"}, + "ScharrTransform": {"absolute", "in_seg", "mix_in_out", "mix_prob", "out_seg", "probability", "retain_stats"}, + "UnsharpMaskTransform": {"in_seg", "mix_in_out", "mix_prob", "out_seg", "probability", "sigma", "unsharp_amount"}, + "RandomConvTransform": {"in_seg", "kernel_sizes", "mix_in_out", "mix_prob", "out_seg", "probability", "retain_stats"}, + "ClampTransform": {"in_seg", "max_clamp_amount", "mix_in_out", "out_seg", "probability", "retain_stats"}, + "GaussianNoiseTransform": {"in_seg", "mean", "mix_in_out", "out_seg", "probability", "std"}, + "GaussianBlurTransform": {"in_seg", "mix_in_out", "out_seg", "probability", "sigma"}, + "BrightnessTransform": {"brightness_range", "in_seg", "mix_in_out", "out_seg", "probability"}, + "GammaTransform": {"gamma_range", "in_seg", "mix_in_out", "out_seg", "probability", "retain_stats"}, + "InvGammaTransform": {"gamma_range", "in_seg", "mix_in_out", "out_seg", "probability", "retain_stats"}, + "ContrastTransform": {"contrast_range", "in_seg", "mix_in_out", "out_seg", "probability", "retain_stats"}, + "FunctionTransform": {"in_seg", "mix_in_out", "out_seg", "probability", "retain_stats"}, + "SimulateLowResTransform": {"probability", "same_on_batch", "scale"}, + "AcqTransform": {"probability", "same_on_batch", "scale"}, + "CropTransform": {"crop", "pos", "probability", "same_on_batch"}, + "BiasFieldTransform": {"coefficients", "in_seg", "mix_in_out", "out_seg", "probability", "retain_stats"}, + "ZscoreNormalizationTransform": {"probability"}, +} + +FORWARDED_CPU_PARAMS: dict[str, set[str]] = { + "ConvTransform": {"absolute", "kernel_type", "probability", "retain_stats"}, + "FunctionTransform": {"probability", "retain_stats"}, + "HistogramEqualTransform": {"probability", "retain_stats"}, + "RedistributeTransform": {"in_seg", "probability", "retain_stats"}, + "ShapeTransform": {"ignore_axes", "probability", "shape_min"}, + "ArtifactTransform": {"bias_field", "blur", "ghosting", "motion", "noise", "probability", "random_pick", "spike", "swap"}, + "SpatialCustomTransform": {"affine", "anisotropy", "elastic", "flip", "probability", "random_pick"}, + "SpatialTransform": { + "bg_style_seg_sampling", + "p_elastic_deform", + "p_rotation", + "p_scaling", + "p_synchronize_scaling_across_axes", + "patch_center_dist_from_border", + "random_crop", + "scaling", + }, + "GaussianNoiseTransform": {"noise_variance", "p_per_channel", "probability", "synchronize_channels"}, + "GaussianBlurTransform": {"benchmark", "blur_sigma", "p_per_channel", "probability", "synchronize_axes", "synchronize_channels"}, + "MultiplicativeBrightnessTransform": {"multiplier_range", "p_per_channel", "probability", "synchronize_channels"}, + "ContrastTransform": {"contrast_range", "p_per_channel", "preserve_range", "probability", "synchronize_channels"}, + "SimulateLowResolutionTransform": { + "allowed_channels", + "ignore_axes", + "p_per_channel", + "probability", + "scale", + "synchronize_axes", + "synchronize_channels", + }, + "GammaTransform_invert": {"gamma", "p_per_channel", "p_retain_stats", "probability", "synchronize_channels"}, + "GammaTransform": {"gamma", "p_invert_image", "p_per_channel", "p_retain_stats", "probability", "synchronize_channels"}, +} + +#: SynthSeg is the exception: the builder forwarded every key except `probability` +#: straight to SynthSegGenerator, so its accepted set is the generator's signature. +FORWARD_EVERYTHING = {"SynthSeg"} + +#: Renamed parameters. +PARAM_RENAMES = {"probability": "p", "shear": "shears"} + +#: Values the old builder hardcoded, which no config carried and no class defaults to. +#: Without these the migrated config would quietly change behaviour -- nnU-Net's +#: SpatialTransform defaults `mode_seg` to "bilinear", which would interpolate +#: segmentation labels into fractional values instead of resampling them nearest. +LADDER_CONSTANTS: dict[tuple[str, str], dict[str, Any]] = { + ("CPU", "SpatialTransform"): {"mode_seg": "nearest"}, +} + +#: Keys whose transform no longer exists at all. The classes were deleted or only +#: ever lived on a branch, so these blocks have been silently doing nothing. +DEAD_KEYS = { + "ImageContrastGPUTransform": "the class was removed in 0d6270d; its num_bins parameter maps to nothing that still exists", + "PaletteSynthesisTransform": "only ever existed on the palette-refactor branch", +} + +#: Every legacy spelling, for the test that proves none of them still resolve. +LEGACY_KEYS = set(LEGACY_GPU_KEYS) | set(LEGACY_CPU_KEYS) | set(DEAD_KEYS) | {"FunctionTransform", "ConvTransform"} + +RESERVED_SECTIONS = ("GPU", "CPU", "MONAI", "pipeline") + + +class MigrationError(Exception): + """The config cannot be migrated without a human deciding something.""" + + +#: Parameter names that only ever appear in a pre-registry config. +_LEGACY_PARAM_MARKERS = frozenset({"probability", "shear", "kernel_type"}) + + +def is_current(payload: dict) -> bool: + """True if the document is already in the current format. + + Decided per document, not per key, because most CPU legacy keys *are* also + current class names (`RedistributeTransform` names a class and named one + before). Keying off that coincidence made the migrator skip the + forwarded-parameter filter on legacy CPU configs and leak parameters the old + builder never passed on. + """ + if not any(section in payload for section in ("GPU", "CPU")): + return False # flat legacy layout, backend never stated + for backend in (Backend.GPU, Backend.CPU): + section = payload.get(backend.value) + if not isinstance(section, dict): + continue + known = set(registry.names(backend)) + for key, block in section.items(): + if key.startswith("_"): + continue + if key not in known: + return False + if isinstance(block, dict) and _LEGACY_PARAM_MARKERS & set(block): + return False + return True + + +def _looks_like_gpu(section: dict) -> bool: + """A flat legacy config carries no section marker, so infer from its keys.""" + gpu_only = {"FlipTransform", "AffineTransform", "ScharrTransform", "ZscoreNormalizationTransform", "AcqTransform"} + cpu_only = {"SpatialCustomTransform", "ArtifactTransform", "ShapeTransform", "GammaTransform_invert"} + return len(gpu_only & set(section)) >= len(cpu_only & set(section)) + + +def _migrate_block(new_name: str, params: dict, backend: Backend, source: str, legacy_key: str | None = None) -> dict[str, Any]: + """Rename parameters, and drop the ones that never reached the transform.""" + entry = registry.get(new_name, backend) + accepted = set(registry.accepted_params(entry)) + forwarded = (FORWARDED_GPU_PARAMS if backend is Backend.GPU else FORWARDED_CPU_PARAMS).get(legacy_key or "") + + out: dict[str, Any] = {} + for key, value in params.items(): + name = PARAM_RENAMES.get(key, key) + if name in entry.context_params: + # Supplied by the trainer at runtime; a config value was always ignored. + continue + if forwarded is not None and legacy_key not in FORWARD_EVERYTHING and key not in forwarded: + # The old builder never read this key, so it has never had an effect. + # Keeping it would switch on a setting that has always been dormant. + continue + if name not in accepted: + # Silently swallowed by **kwargs before, so dropping it changes nothing. + continue + out[name] = value + if backend is Backend.GPU and "p" not in out: + # The old builder defaulted an absent probability to 0 (the block was there + # but off). Spelling it out keeps that meaning now that an absent block is + # what "not in the pipeline" means. + out["p"] = 0 + # Values the builder hardcoded rather than reading from the config. + out.update(LADDER_CONSTANTS.get((backend.value, new_name), {})) + _ = source + return out + + +def _migrate_section(section: dict, backend: Backend, source: str) -> tuple[dict, list[str]]: + """Return the migrated section plus a list of human-readable notes.""" + keymap = LEGACY_GPU_KEYS if backend is Backend.GPU else LEGACY_CPU_KEYS + forwarded_table = FORWARDED_GPU_PARAMS if backend is Backend.GPU else FORWARDED_CPU_PARAMS + migrated: dict[str, Any] = {} + notes: list[str] = [] + + # The CPU builder read `retain_stats` from the *top level* of the config and + # applied it to every block that takes one, rather than reading it per block. + # Push it down so each transform states its own value. + shared_retain_stats = section.get("retain_stats") if backend is Backend.CPU else None + if shared_retain_stats is not None: + notes.append(f"pushed top-level retain_stats={shared_retain_stats} into the blocks that read it") + + for key, value in section.items(): + if key.startswith("_") or key in RESERVED_SECTIONS: + continue + if key in ("Comment1", "Comment2"): + migrated[f"_comment{key[-1]}"] = value + continue + if key in DEAD_KEYS: + notes.append(f"dropped {key!r}: {DEAD_KEYS[key]}") + continue + if key in ("mirror_axes", "retain_stats", "nnUNetSpatialTransform", "RandomChooseXTransforms"): + continue # relocated by the caller + if not isinstance(value, dict): + notes.append(f"dropped non-block key {key!r}") + continue + + block = value + if shared_retain_stats is not None and "retain_stats" in forwarded_table.get(key, ()): + block = {**value, "retain_stats": shared_retain_stats} + + if key == "FunctionTransform": + for leaf in FUNCTION_LEAVES[backend]: + migrated[leaf] = _migrate_block(leaf, block, backend, source, legacy_key=key) + notes.append(f"expanded FunctionTransform into {len(FUNCTION_LEAVES[backend])} blocks") + continue + + if key == "ConvTransform" and backend is Backend.CPU: + kernel = block.get("kernel_type", "Scharr") + if kernel not in CPU_CONV_BY_KERNEL: + raise MigrationError(f"{source}: ConvTransform has unsupported kernel_type {kernel!r}") + leaf = CPU_CONV_BY_KERNEL[kernel] + migrated[leaf] = _migrate_block(leaf, block, backend, source, legacy_key=key) + notes.append(f"ConvTransform(kernel_type={kernel!r}) -> {leaf}") + continue + + new_name = keymap.get(key) + if new_name is None: + raise MigrationError( + f"{source}: no migration rule for {backend.value} key {key!r}. " + "Add it to LEGACY_GPU_KEYS/LEGACY_CPU_KEYS, or delete the block if the transform is gone." + ) + migrated[new_name] = _migrate_block(new_name, block, backend, source, legacy_key=key) + + # Emit in registry order so the file reads in the order the pipeline runs. + order = {name: i for i, name in enumerate(registry.names(backend))} + ordered = {k: migrated[k] for k in sorted(migrated, key=lambda n: (n.startswith("_") is False, order.get(n, 10_000), n))} + return ordered, notes + + +def migrate(payload: dict, source: str = "") -> tuple[dict, list[str]]: + """Migrate a whole config document. Returns (new payload, notes).""" + payload = copy.deepcopy(payload) + out: dict[str, Any] = {} + notes: list[str] = [] + + if is_current(payload): + # Nothing to rewrite; only normalise section order so migrating twice + # produces the same bytes as migrating once. + return _ordered(payload), notes + + sections: dict[Backend, dict] = {} + if "GPU" in payload or "CPU" in payload: + if isinstance(payload.get("GPU"), dict): + sections[Backend.GPU] = payload["GPU"] + if isinstance(payload.get("CPU"), dict): + sections[Backend.CPU] = payload["CPU"] + else: + sections[Backend.GPU if _looks_like_gpu(payload) else Backend.CPU] = payload + + out.update({key: value for key, value in payload.items() if key.startswith("_")}) + + for backend, section in sections.items(): + migrated, section_notes = _migrate_section(section, backend, source) + notes.extend(section_notes) + + # nnUNetSpatialTransform is not a GPU augmentation -- AugTransformsGPU never + # read it. It configures nnU-Net's own CPU-side SpatialTransform, which the + # trainer used to fetch by re-opening the JSON a second time. + spatial = section.get("nnUNetSpatialTransform") + if isinstance(spatial, dict): + target = out.setdefault(Backend.CPU.value, {}) + target["SpatialTransform"] = _migrate_block("SpatialTransform", spatial, Backend.CPU, source, legacy_key="SpatialTransform") + notes.append("moved nnUNetSpatialTransform -> CPU.SpatialTransform") + + if backend is Backend.CPU: + axes = section.get("mirror_axes") + if axes: + migrated["MirrorTransform"] = {"allowed_axes": axes} + notes.append("moved mirror_axes -> CPU.MirrorTransform.allowed_axes") + + choose = section.get("RandomChooseXTransforms") + if isinstance(choose, dict): + out.setdefault("pipeline", {})["random_choose"] = choose + notes.append("moved RandomChooseXTransforms -> pipeline.random_choose") + + if migrated: + existing = out.get(backend.value, {}) + out[backend.value] = {**migrated, **existing} + + return _ordered(out), notes + + +def _ordered(payload: dict) -> dict: + """Fixed section order, so migrating twice gives the same bytes as once. + + Without this the order depends on whether a relocation + (nnUNetSpatialTransform -> CPU.SpatialTransform) created the CPU section first. + """ + order = ["GPU", "CPU", "MONAI", "pipeline"] + out = {k: payload[k] for k in payload if k.startswith("_")} + out.update({k: payload[k] for k in order if k in payload}) + out.update({k: v for k, v in payload.items() if k not in out}) + return out + + +def needs_migration(payload: dict) -> bool: + """True if the document is not already in the current format.""" + try: + migrated, _ = migrate(payload) + except MigrationError: + return True + return migrated != payload + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(prog="smauglab migrate", description=__doc__) + parser.add_argument("configs", nargs="+", type=Path) + parser.add_argument("-o", "--output", type=Path, help="write here instead of alongside the input") + parser.add_argument("--in-place", action="store_true") + parser.add_argument("--check", action="store_true", help="exit 1 if any config would change") + args = parser.parse_args(argv) + + if args.output and len(args.configs) > 1: + parser.error("-o takes a single input config") + + stale = 0 + for path in args.configs: + payload = json.loads(path.read_text()) + try: + migrated, notes = migrate(payload, source=path.name) + except MigrationError as exc: + print(f"{path}: {exc}", file=sys.stderr) + return 2 + + text = json.dumps(migrated, indent=4) + "\n" + if args.check: + if path.read_text() != text: + stale += 1 + print(f"needs migration: {path}") + for note in notes: + print(f" {note}") + continue + + target = args.output or (path if args.in_place else path.with_suffix(".migrated.json")) + target.write_text(text) + print(f"{path} -> {target}") + for note in notes: + print(f" {note}") + + return 1 if stale else 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/smauglab/configs/transform_params.json b/smauglab/configs/transform_params.json index 1c3b07b..621c5ff 100644 --- a/smauglab/configs/transform_params.json +++ b/smauglab/configs/transform_params.json @@ -1,98 +1,144 @@ { - "retain_stats": true, - "mirror_axes": [0,1,2], - "ArtifactTransform": { - "motion": false, - "ghosting": false, - "spike": false, - "bias_field": false, - "blur": false, - "noise": false, - "swap": false, - "random_pick": false, - "probability": 0.7 - }, - "SpatialCustomTransform": { - "flip": false, - "affine": false, - "elastic": false, - "anisotropy": false, - "random_pick": false, - "probability": 0.6 - }, - "ConvTransform": { - "kernel_type": "Laplace", - "absolute": false, - "retain_stats": false, - "probability": 0.15 - }, - "RedistributeTransform": { - "classes": null, - "in_seg": 0.2, - "retain_stats": false, - "probability": 0.5 - }, - "ShapeTransform": { - "shape_min": 1, - "ignore_axes": [1,2], - "probability": 0.4 - }, - "HistogramEqualTransform": { - "probability": 0.1 - }, - "FunctionTransform": { - "probability": 0.05 - }, - "GaussianNoiseTransform": { - "noise_variance": [0, 0.1], - "p_per_channel": 1, - "synchronize_channels": true, - "probability": 0.1 - }, - "GaussianBlurTransform": { - "blur_sigma": [0.5, 1.0], - "synchronize_channels": false, - "synchronize_axes": false, - "p_per_channel": 0.5, - "benchmark": true, - "probability": 0.2 - }, - "MultiplicativeBrightnessTransform": { - "multiplier_range": [0.75, 1.25], - "synchronize_channels": false, - "p_per_channel": 1, - "probability": 0.15 - }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], - "preserve_range": true, - "synchronize_channels": false, - "p_per_channel": 1, - "probability": 0.15 - }, - "SimulateLowResolutionTransform": { - "scale": [0.3, 1], - "synchronize_channels": true, - "synchronize_axes": false, - "ignore_axes": [], - "allowed_channels": null, - "p_per_channel": 0.5, - "probability": 0.2 - }, - "GammaTransform_invert": { - "gamma": [0.7, 1.5], - "p_invert_image": 1, - "synchronize_channels": false, - "p_per_channel": 1, - "p_retain_stats": 1, - "probability": 0.1 - }, - "GammaTransform": { - "gamma": [0.7, 1.5], - "p_invert_image": 0, - "synchronize_channels": false, - "p_per_channel": 1, - "p_retain_stats": 1, - "probability": 0.3 - } + "CPU": { + "LaplaceConvTransform": { + "absolute": false, + "retain_stats": true, + "p": 0.15 + }, + "Log1pTransform": { + "p": 0.05, + "retain_stats": true + }, + "SqrtTransform": { + "p": 0.05, + "retain_stats": true + }, + "SinTransform": { + "p": 0.05, + "retain_stats": true + }, + "ExpTransform": { + "p": 0.05, + "retain_stats": true + }, + "SigmoidTransform": { + "p": 0.05, + "retain_stats": true + }, + "HistogramEqualTransform": { + "p": 0.1, + "retain_stats": true + }, + "RedistributeTransform": { + "in_seg": 0.2, + "retain_stats": true, + "p": 0.5 + }, + "ShapeTransform": { + "shape_min": 1, + "ignore_axes": [ + 1, + 2 + ], + "p": 0.4 + }, + "ArtifactTransform": { + "motion": false, + "ghosting": false, + "spike": false, + "bias_field": false, + "blur": false, + "noise": false, + "swap": false, + "random_pick": false, + "p": 0.7 + }, + "SpatialCustomTransform": { + "flip": false, + "affine": false, + "elastic": false, + "anisotropy": false, + "random_pick": false, + "p": 0.6 + }, + "GaussianNoiseTransform": { + "noise_variance": [ + 0, + 0.1 + ], + "p_per_channel": 1, + "synchronize_channels": true, + "p": 0.1 + }, + "GaussianBlurTransform": { + "blur_sigma": [ + 0.5, + 1.0 + ], + "synchronize_channels": false, + "synchronize_axes": false, + "p_per_channel": 0.5, + "benchmark": true, + "p": 0.2 + }, + "MultiplicativeBrightnessTransform": { + "multiplier_range": [ + 0.75, + 1.25 + ], + "synchronize_channels": false, + "p_per_channel": 1, + "p": 0.15 + }, + "ContrastTransform": { + "contrast_range": [ + 0.75, + 1.25 + ], + "preserve_range": true, + "synchronize_channels": false, + "p_per_channel": 1, + "p": 0.15 + }, + "SimulateLowResolutionTransform": { + "scale": [ + 0.3, + 1 + ], + "synchronize_channels": true, + "synchronize_axes": false, + "ignore_axes": [], + "allowed_channels": null, + "p_per_channel": 0.5, + "p": 0.2 + }, + "InvertedGammaTransform": { + "gamma": [ + 0.7, + 1.5 + ], + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "p": 0.1 + }, + "GammaTransform": { + "gamma": [ + 0.7, + 1.5 + ], + "p_invert_image": 0, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "p": 0.3 + }, + "MirrorTransform": { + "allowed_axes": [ + 0, + 1, + 2 + ] + } + } } diff --git a/smauglab/configs/transform_params_gpu.json b/smauglab/configs/transform_params_gpu.json index 397eb91..05e170b 100644 --- a/smauglab/configs/transform_params_gpu.json +++ b/smauglab/configs/transform_params_gpu.json @@ -1,209 +1,282 @@ { - "RandomPALETTETransform": { - "probability": 0.25, - "c_choices": [ - 2, - 3, - 4, - 5, - 6 - ], - "s_choices": [ - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ], - "blur_sigmas": [ - 0.0, - 0.0, - 0.0, - 0.3, - 0.5, - 0.8 - ], - "dark_threshold": 0.01, - "n_kmeans_subsample": 10000, - "skip_parcellation_prob": 0.1, - "skip_sub_parc_prob": 0.4, - "alpha_magnitude_range": [ - 0.5, - 2.0 - ], - "label_remap_prob": 0.5, - "min_label_voxels": 4, - "label_classes": null + "GPU": { + "RandomFlipTransformGPU": { + "flip_axis": [ + 0 + ], + "same_on_batch": false, + "keepdim": true, + "p": 0.5 + }, + "RandomAffineGPU": { + "degrees": 5, + "translate": [ + 0.1, + 0.1, + 0.1 + ], + "scale": [ + 0.7, + 1.4 + ], + "shears": [ + -5, + 5, + -5, + 5, + -5, + 5 + ], + "resample": "bilinear", + "p": 0.0 + }, + "RandomPaletteGPU": { + "p": 0.25, + "c_choices": [ + 2, + 3, + 4, + 5, + 6 + ], + "s_choices": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "blur_sigmas": [ + 0.0, + 0.0, + 0.0, + 0.3, + 0.5, + 0.8 + ], + "dark_threshold": 0.01, + "n_kmeans_subsample": 10000, + "skip_parcellation_prob": 0.1, + "skip_sub_parc_prob": 0.4, + "alpha_magnitude_range": [ + 0.5, + 2.0 + ], + "label_remap_prob": 0.5, + "min_label_voxels": 4, + "label_classes": null + }, + "RandomInverseGPU": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.0, + "p": 0.25 + }, + "RandomHistogramEqualizationGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.6, + "p": 0.25 + }, + "RandomRedistributeSegGPU": { + "in_seg": 0.25, + "retain_stats": true, + "p": 0.4 + }, + "RandomScharrGPU": { + "absolute": true, + "retain_stats": true, + "mix_prob": 0.5, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.25 + }, + "RandomUnsharpMaskGPU": { + "sigma": 1.0, + "unsharp_amount": 1.5, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.5, + "p": 0.25 + }, + "RandomRandConvGPU": { + "kernel_sizes": [ + 3, + 5, + 7 + ], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.5, + "p": 0.2 + }, + "RandomClampGPU": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.0 + }, + "RandomGaussianNoiseGPU": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.1 + }, + "RandomGaussianBlurGPU": { + "sigma": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.2 + }, + "RandomBrightnessGPU": { + "brightness_range": [ + 0.75, + 1.25 + ], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.15 + }, + "RandomGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.3 + }, + "RandomInvGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.1 + }, + "RandomContrastGPU": { + "contrast_range": [ + 0.75, + 1.25 + ], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.15 + }, + "RandomLog1pGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomSqrtGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomSinGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomExpGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomSigmoidGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomLowResTransformGPU": { + "scale": [ + 0.5, + 1.0 + ], + "same_on_batch": false, + "p": 0.25 + }, + "RandomAcqTransformGPU": { + "scale": [ + 0.1, + 1.0 + ], + "same_on_batch": false, + "p": 0.2 + }, + "RandomCropTransformGPU": { + "crop": [ + 0.5, + 1.0 + ], + "pos": [ + 0.0, + 1.0 + ], + "same_on_batch": false, + "p": 0.25 + }, + "RandomBiasFieldGPU": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.15 + }, + "ZscoreNormalizationGPU": { + "p": 0.0 + } }, - "ScharrTransform": { - "kernel_type": "Scharr", - "absolute": true, - "retain_stats": true, - "mix_prob": 0.50, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.25 - }, - "GaussianBlurTransform": { - "kernel_type": "GaussianBlur", - "sigma": 1.0, - "retain_stats": false, - "mix_prob": 0.00, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.20 - }, - "UnsharpMaskTransform": { - "kernel_type": "UnsharpMask", - "sigma": 1.0, - "unsharp_amount": 1.5, - "retain_stats": false, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "mix_prob": 0.50, - "probability": 0.25 - }, - "RandomConvTransform": { - "kernel_type": "RandConv", - "kernel_sizes": [3,5,7], - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "mix_prob": 0.50, - "probability": 0.20 - }, - "RedistributeSegTransform": { - "in_seg": 0.25, - "retain_stats": true, - "probability": 0.4 - }, - "GaussianNoiseTransform": { - "mean": 0.0, - "std": 1.0, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.1 - }, - "ClampTransform": { - "max_clamp_amount": 0.2, - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.00 - }, - "BrightnessTransform": { - "brightness_range": [0.75, 1.25], - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.15 - }, - "GammaTransform": { - "gamma_range": [0.7, 1.5], - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.30 - }, - "InvGammaTransform": { - "gamma_range": [0.7, 1.5], - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.10 - }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], - "retain_stats": false, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.15 - }, - "FunctionTransform": { - "retain_stats": true, - "in_seg": 0, - "out_seg": 0, - "mix_in_out": false, - "probability": 0.1 - }, - "InverseTransform": { - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "mix_prob": 0.00, - "probability": 0.25 - }, - "HistogramEqualizationTransform": { - "retain_stats": true, - "in_seg": 0, - "out_seg": 0, - "mix_in_out": true, - "mix_prob": 0.60, - "probability": 0.25 - }, - "SimulateLowResTransform": { - "scale": [0.5, 1.0], - "same_on_batch": false, - "probability": 0.25 - }, - "AcqTransform": { - "scale": [0.1, 1.0], - "same_on_batch": false, - "probability": 0.2 - }, - "CropTransform": { - "crop": [0.5, 1.0], - "pos": [0.0, 1.0], - "same_on_batch": false, - "probability": 0.25 - }, - "BiasFieldTransform": { - "retain_stats": true, - "coefficients": 0.2, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.15 - }, - "FlipTransform": { - "flip_axis": [0], - "same_on_batch": false, - "keepdim": true, - "probability": 0.5 - }, - "AffineTransform": { - "degrees": 5, - "translate": [0.1, 0.1, 0.1], - "scale": [0.7, 1.4], - "shear": [-5, 5, -5, 5, -5, 5], - "resample": "bilinear", - "probability": 0.0 - }, - "nnUNetSpatialTransform": { - "patch_center_dist_from_border": 80, - "random_crop": false, - "p_elastic_deform": 0.0, - "p_rotation": 0.2, - "p_scaling": 0.2, - "scaling": [0.7, 1.4], - "p_synchronize_scaling_across_axes": 1, - "bg_style_seg_sampling": false - }, - "ZscoreNormalizationTransform": { - "probability": 0.00 + "CPU": { + "SpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [ + 0.7, + 1.4 + ], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false, + "mode_seg": "nearest" + } } } diff --git a/smauglab/configs/transform_params_hybrid.json b/smauglab/configs/transform_params_hybrid.json index d27cce8..14175bf 100644 --- a/smauglab/configs/transform_params_hybrid.json +++ b/smauglab/configs/transform_params_hybrid.json @@ -1,262 +1,362 @@ { - "CPU": { - "Comment1": "AugLab custom CPU augmentations", - "ConvTransform": { - "kernel_type": "Scharr", - "absolute": true, - "retain_stats": false, - "probability": 0.15 + "GPU": { + "_comment1": "AugLab custom GPU augmentations", + "RandomFlipTransformGPU": { + "flip_axis": [ + 0 + ], + "same_on_batch": false, + "keepdim": true, + "p": 0 }, - "FunctionTransform": { + "RandomAffineGPU": { + "degrees": 10, + "translate": [ + 0.1, + 0.1, + 0.1 + ], + "scale": [ + 0.7, + 1.4 + ], + "shears": [ + -10, + 10, + -10, + 10, + -10, + 10 + ], + "resample": "bilinear", + "p": 0 + }, + "RandomInverseGPU": { "retain_stats": false, - "probability": 0.05 + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.3 }, - "HistogramEqualTransform": { + "RandomHistogramEqualizationGPU": { "retain_stats": false, - "probability": 0.1 + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.2 }, - "RedistributeTransform": { + "RandomRedistributeSegGPU": { "in_seg": 0.2, "retain_stats": false, - "probability": 0.5 - }, - "ShapeTransform": { - "shape_min": 1, - "ignore_axes": [1,2], - "probability": 0.4 - }, - "ArtifactTransform":{ - "motion": true, - "ghosting": true, - "spike": true, - "bias_field": true, - "blur": true, - "noise": true, - "swap": false, - "random_pick": true, - "probability": 0 + "p": 0.3 }, - "SpatialCustomTransform": { - "flip": true, - "affine": true, - "elastic": true, - "anisotropy": true, - "random_pick": true, - "probability": 0 - }, - - "Comment2": "nnUNet default CPU augmentations", - "SpatialTransform": { - "patch_center_dist_from_border": 0, - "random_crop": false, - "p_elastic_deform": 0, - "p_rotation": 0.2, - "p_scaling": 0.2, - "scaling": [0.7, 1.4], - "p_synchronize_scaling_across_axes": 1, - "bg_style_seg_sampling": false - }, - "GaussianNoiseTransform": { - "noise_variance": [0, 0.1], - "p_per_channel": 1, - "synchronize_channels": true, - "probability": 0.1 - }, - "GaussianBlurTransform": { - "blur_sigma": [0.5, 1.0], - "synchronize_channels": false, - "synchronize_axes": false, - "p_per_channel": 0.5, - "benchmark": true, - "probability": 0.2 - }, - "MultiplicativeBrightnessTransform": { - "multiplier_range": [0.75, 1.25], - "synchronize_channels": false, - "p_per_channel": 1, - "probability": 0.15 - }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], - "preserve_range": true, - "synchronize_channels": false, - "p_per_channel": 1, - "probability": 0.15 - }, - "SimulateLowResolutionTransform": { - "scale": [0.3, 1], - "synchronize_channels": true, - "synchronize_axes": false, - "ignore_axes": [], - "p_per_channel": 0.5, - "probability": 0.2 - }, - "GammaTransform_invert": { - "gamma": [0.7, 1.5], - "p_invert_image": 1, - "synchronize_channels": false, - "p_per_channel": 1, - "p_retain_stats": 1, - "probability": 0.1 - }, - "GammaTransform": { - "gamma": [0.7, 1.5], - "p_invert_image": 0, - "synchronize_channels": false, - "p_per_channel": 1, - "p_retain_stats": 1, - "probability": 0.3 - } - }, - "GPU": { - "Comment1": "AugLab custom GPU augmentations", - "ScharrTransform": { - "kernel_type": "Scharr", + "RandomScharrGPU": { "absolute": true, "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.15 + "p": 0.15 }, - "GaussianBlurTransform": { - "kernel_type": "GaussianBlur", + "RandomUnsharpMaskGPU": { "sigma": 1.0, - "retain_stats": false, + "unsharp_amount": 1, "in_seg": 0.5, "out_seg": 0.5, - "mix_in_out": false, - "probability": 0.10 - }, - "UnsharpMaskTransform": { - "kernel_type": "UnsharpMask", - "sigma": 1.0, - "unsharp_amount": 1, + "mix_in_out": true, + "p": 0.1 + }, + "RandomRandConvGPU": { + "kernel_sizes": [ + 1, + 3, + 5, + 7 + ], "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.10 + "mix_prob": 0.2, + "p": 0.1 }, - "RandomConvTransform": { - "kernel_type": "RandConv", - "kernel_sizes": [1,3,5,7], + "RandomClampGPU": { + "max_clamp_amount": 0.2, "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "mix_prob": 0.20, - "probability": 0.10 - }, - "RedistributeSegTransform": { - "in_seg": 0.2, - "retain_stats": false, - "probability": 0.3 + "p": 0.4 }, - "GaussianNoiseTransform": { + "RandomGaussianNoiseGPU": { "mean": 0.0, "std": 0.1, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.10 + "p": 0.1 }, - "ClampTransform": { - "max_clamp_amount": 0.2, - "retain_stats": false, + "RandomGaussianBlurGPU": { + "sigma": 1.0, "in_seg": 0.5, "out_seg": 0.5, - "mix_in_out": true, - "probability": 0.40 + "mix_in_out": false, + "p": 0.1 }, - "BrightnessTransform": { - "brightness_range": [0.75, 1.25], + "RandomBrightnessGPU": { + "brightness_range": [ + 0.75, + 1.25 + ], "in_seg": 0.0, "out_seg": 0.0, "mix_in_out": false, - "probability": 0.15 + "p": 0.15 }, - "GammaTransform": { - "gamma_range": [0.7, 1.5], + "RandomGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.30 + "p": 0.3 }, - "InvGammaTransform": { - "gamma_range": [0.7, 1.5], + "RandomInvGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.10 + "p": 0.1 }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], + "RandomContrastGPU": { + "contrast_range": [ + 0.75, + 1.25 + ], "retain_stats": false, "in_seg": 0.0, "out_seg": 0.0, "mix_in_out": false, - "probability": 0.15 + "p": 0.15 + }, + "RandomLog1pGPU": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.05 }, - "FunctionTransform": { + "RandomSqrtGPU": { "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.05 + "p": 0.05 }, - "InverseTransform": { + "RandomSinGPU": { "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.30 + "p": 0.05 }, - "HistogramEqualizationTransform": { + "RandomExpGPU": { "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.20 + "p": 0.05 }, - "SimulateLowResTransform": { - "scale": [0.5, 1.0], - "crop": [0.8, 1.0], + "RandomSigmoidGPU": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.05 + }, + "RandomLowResTransformGPU": { + "scale": [ + 0.5, + 1.0 + ], "same_on_batch": false, - "probability": 0.25 + "p": 0.25 }, - "AcqTransform": { - "scale": [0.2, 1.0], - "crop": [1.0, 1.0], + "RandomAcqTransformGPU": { + "scale": [ + 0.2, + 1.0 + ], "same_on_batch": false, - "probability": 0.40 + "p": 0.4 }, - "BiasFieldTransform": { + "RandomBiasFieldGPU": { "retain_stats": false, "coefficients": 0.5, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": false, - "probability": 0.20 + "p": 0.2 }, - "FlipTransform": { - "flip_axis": [0], - "same_on_batch": false, - "keepdim": true, - "probability": 0 + "ZscoreNormalizationGPU": { + "p": 0.3 + } + }, + "CPU": { + "_comment1": "AugLab custom CPU augmentations", + "_comment2": "nnUNet default CPU augmentations", + "ScharrConvTransform": { + "absolute": true, + "retain_stats": false, + "p": 0.15 }, - "AffineTransform": { - "degrees": 10, - "translate": [0.1, 0.1, 0.1], - "scale": [0.7, 1.4], - "shear": [-10, 10, -10, 10, -10, 10], - "resample": "bilinear", - "probability": 0 + "Log1pTransform": { + "retain_stats": false, + "p": 0.05 + }, + "SqrtTransform": { + "retain_stats": false, + "p": 0.05 + }, + "SinTransform": { + "retain_stats": false, + "p": 0.05 + }, + "ExpTransform": { + "retain_stats": false, + "p": 0.05 + }, + "SigmoidTransform": { + "retain_stats": false, + "p": 0.05 + }, + "HistogramEqualTransform": { + "retain_stats": false, + "p": 0.1 + }, + "RedistributeTransform": { + "in_seg": 0.2, + "retain_stats": false, + "p": 0.5 + }, + "ShapeTransform": { + "shape_min": 1, + "ignore_axes": [ + 1, + 2 + ], + "p": 0.4 + }, + "ArtifactTransform": { + "motion": true, + "ghosting": true, + "spike": true, + "bias_field": true, + "blur": true, + "noise": true, + "swap": false, + "random_pick": true, + "p": 0 }, - "ZscoreNormalizationTransform": { - "probability": 0.3 + "SpatialCustomTransform": { + "flip": true, + "affine": true, + "elastic": true, + "anisotropy": true, + "random_pick": true, + "p": 0 + }, + "SpatialTransform": { + "patch_center_dist_from_border": 0, + "random_crop": false, + "p_elastic_deform": 0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [ + 0.7, + 1.4 + ], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false, + "mode_seg": "nearest" + }, + "GaussianNoiseTransform": { + "noise_variance": [ + 0, + 0.1 + ], + "p_per_channel": 1, + "synchronize_channels": true, + "p": 0.1 + }, + "GaussianBlurTransform": { + "blur_sigma": [ + 0.5, + 1.0 + ], + "synchronize_channels": false, + "synchronize_axes": false, + "p_per_channel": 0.5, + "benchmark": true, + "p": 0.2 + }, + "MultiplicativeBrightnessTransform": { + "multiplier_range": [ + 0.75, + 1.25 + ], + "synchronize_channels": false, + "p_per_channel": 1, + "p": 0.15 + }, + "ContrastTransform": { + "contrast_range": [ + 0.75, + 1.25 + ], + "preserve_range": true, + "synchronize_channels": false, + "p_per_channel": 1, + "p": 0.15 + }, + "SimulateLowResolutionTransform": { + "scale": [ + 0.3, + 1 + ], + "synchronize_channels": true, + "synchronize_axes": false, + "ignore_axes": [], + "p_per_channel": 0.5, + "p": 0.2 + }, + "InvertedGammaTransform": { + "gamma": [ + 0.7, + 1.5 + ], + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "p": 0.1 + }, + "GammaTransform": { + "gamma": [ + 0.7, + 1.5 + ], + "p_invert_image": 0, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "p": 0.3 } } } diff --git a/smauglab/configs/transform_params_hybrid_TAGE.json b/smauglab/configs/transform_params_hybrid_TAGE.json index 9382fc6..2e2e052 100644 --- a/smauglab/configs/transform_params_hybrid_TAGE.json +++ b/smauglab/configs/transform_params_hybrid_TAGE.json @@ -1,264 +1,363 @@ { - "CPU": { - "Comment1": "CPU transfer augmentations (TA)", - "ConvTransform": { - "kernel_type": "Scharr", - "absolute": true, - "retain_stats": false, - "probability": 0.15 + "GPU": { + "_comment1": "GPU transfer augmentations (TA)", + "_comment2": "GPU general enhancement (GE)", + "RandomFlipTransformGPU": { + "flip_axis": [ + 0 + ], + "same_on_batch": false, + "keepdim": true, + "p": 0 }, - "HistogramEqualTransform": { - "retain_stats": false, - "probability": 0.1 + "RandomAffineGPU": { + "degrees": 10, + "translate": [ + 0.1, + 0.1, + 0.1 + ], + "scale": [ + 0.7, + 1.4 + ], + "shears": [ + -10, + 10, + -10, + 10, + -10, + 10 + ], + "resample": "bilinear", + "p": 0 }, - "RedistributeTransform": { - "in_seg": 0.2, + "RandomInverseGPU": { "retain_stats": false, - "probability": 0.5 + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.3 }, - - "Comment2": "CPU general enhancement (GE)", - "FunctionTransform": { + "RandomHistogramEqualizationGPU": { "retain_stats": false, - "probability": 0.05 - }, - "ShapeTransform": { - "shape_min": 1, - "ignore_axes": [1,2], - "probability": 0.4 - }, - "ArtifactTransform":{ - "motion": true, - "ghosting": true, - "spike": true, - "bias_field": true, - "blur": true, - "noise": true, - "swap": false, - "random_pick": true, - "probability": 0 - }, - "SpatialCustomTransform": { - "flip": true, - "affine": true, - "elastic": true, - "anisotropy": true, - "random_pick": true, - "probability": 0 - }, - "SpatialTransform": { - "patch_center_dist_from_border": 0, - "random_crop": false, - "p_elastic_deform": 0, - "p_rotation": 0.2, - "p_scaling": 0.2, - "scaling": [0.7, 1.4], - "p_synchronize_scaling_across_axes": 1, - "bg_style_seg_sampling": false - }, - "GaussianNoiseTransform": { - "noise_variance": [0, 0.1], - "p_per_channel": 1, - "synchronize_channels": true, - "probability": 0.1 - }, - "GaussianBlurTransform": { - "blur_sigma": [0.5, 1.0], - "synchronize_channels": false, - "synchronize_axes": false, - "p_per_channel": 0.5, - "benchmark": true, - "probability": 0.2 - }, - "MultiplicativeBrightnessTransform": { - "multiplier_range": [0.75, 1.25], - "synchronize_channels": false, - "p_per_channel": 1, - "probability": 0.15 - }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], - "preserve_range": true, - "synchronize_channels": false, - "p_per_channel": 1, - "probability": 0.15 - }, - "SimulateLowResolutionTransform": { - "scale": [0.3, 1], - "synchronize_channels": true, - "synchronize_axes": false, - "ignore_axes": [], - "p_per_channel": 0.5, - "probability": 0.2 + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.2 }, - "GammaTransform_invert": { - "gamma": [0.7, 1.5], - "p_invert_image": 1, - "synchronize_channels": false, - "p_per_channel": 1, - "p_retain_stats": 1, - "probability": 0.1 + "RandomRedistributeSegGPU": { + "in_seg": 0.2, + "retain_stats": false, + "p": 0.3 }, - "GammaTransform": { - "gamma": [0.7, 1.5], - "p_invert_image": 0, - "synchronize_channels": false, - "p_per_channel": 1, - "p_retain_stats": 1, - "probability": 0.3 - } - }, - "GPU": { - "Comment1": "GPU transfer augmentations (TA)", - "ScharrTransform": { - "kernel_type": "Scharr", + "RandomScharrGPU": { "absolute": true, "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.15 + "p": 0.15 }, - "UnsharpMaskTransform": { - "kernel_type": "UnsharpMask", + "RandomUnsharpMaskGPU": { "sigma": 1.0, "unsharp_amount": 1, - "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.10 - }, - "RandomConvTransform": { - "kernel_type": "RandConv", - "kernel_sizes": [1,3,5,7], + "p": 0.1 + }, + "RandomRandConvGPU": { + "kernel_sizes": [ + 1, + 3, + 5, + 7 + ], "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "mix_prob": 0.20, - "probability": 0.10 - }, - "RedistributeSegTransform": { - "in_seg": 0.2, - "retain_stats": false, - "probability": 0.3 + "mix_prob": 0.2, + "p": 0.1 }, - "InverseTransform": { + "RandomClampGPU": { + "max_clamp_amount": 0.2, "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.30 + "p": 0.4 }, - "HistogramEqualizationTransform": { - "retain_stats": false, + "RandomGaussianNoiseGPU": { + "mean": 0.0, + "std": 0.1, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.20 + "p": 0.1 }, - - "Comment2": "GPU general enhancement (GE)", - "GaussianBlurTransform": { - "kernel_type": "GaussianBlur", + "RandomGaussianBlurGPU": { "sigma": 1.0, - "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": false, - "probability": 0.10 + "p": 0.1 }, - "GaussianNoiseTransform": { - "mean": 0.0, - "std": 0.1, + "RandomBrightnessGPU": { + "brightness_range": [ + 0.75, + 1.25 + ], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": false, + "p": 0.15 + }, + "RandomGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], + "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.10 + "p": 0.3 }, - "ClampTransform": { - "max_clamp_amount": 0.2, + "RandomInvGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.40 + "p": 0.1 }, - "BrightnessTransform": { - "brightness_range": [0.75, 1.25], + "RandomContrastGPU": { + "contrast_range": [ + 0.75, + 1.25 + ], + "retain_stats": false, "in_seg": 0.0, "out_seg": 0.0, "mix_in_out": false, - "probability": 0.15 + "p": 0.15 }, - "GammaTransform": { - "gamma_range": [0.7, 1.5], + "RandomLog1pGPU": { "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.30 + "p": 0.05 }, - "InvGammaTransform": { - "gamma_range": [0.7, 1.5], + "RandomSqrtGPU": { "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.10 + "p": 0.05 }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], + "RandomSinGPU": { "retain_stats": false, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": false, - "probability": 0.15 + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.05 + }, + "RandomExpGPU": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "p": 0.05 }, - "FunctionTransform": { + "RandomSigmoidGPU": { "retain_stats": false, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": true, - "probability": 0.05 + "p": 0.05 }, - "SimulateLowResTransform": { - "scale": [0.5, 1.0], - "crop": [0.8, 1.0], + "RandomLowResTransformGPU": { + "scale": [ + 0.5, + 1.0 + ], "same_on_batch": false, - "probability": 0.25 + "p": 0.25 }, - "AcqTransform": { - "scale": [0.2, 1.0], - "crop": [1.0, 1.0], + "RandomAcqTransformGPU": { + "scale": [ + 0.2, + 1.0 + ], "same_on_batch": false, - "probability": 0.40 + "p": 0.4 }, - "BiasFieldTransform": { + "RandomBiasFieldGPU": { "retain_stats": false, "coefficients": 0.5, "in_seg": 0.5, "out_seg": 0.5, "mix_in_out": false, - "probability": 0.20 + "p": 0.2 }, - "FlipTransform": { - "flip_axis": [0], - "same_on_batch": false, - "keepdim": true, - "probability": 0 + "ZscoreNormalizationGPU": { + "p": 0 + } + }, + "CPU": { + "_comment1": "CPU transfer augmentations (TA)", + "_comment2": "CPU general enhancement (GE)", + "ScharrConvTransform": { + "absolute": true, + "retain_stats": false, + "p": 0.15 }, - "AffineTransform": { - "degrees": 10, - "translate": [0.1, 0.1, 0.1], - "scale": [0.7, 1.4], - "shear": [-10, 10, -10, 10, -10, 10], - "resample": "bilinear", - "probability": 0 + "Log1pTransform": { + "retain_stats": false, + "p": 0.05 }, - "ZscoreNormalizationTransform": { - "probability": 0 + "SqrtTransform": { + "retain_stats": false, + "p": 0.05 + }, + "SinTransform": { + "retain_stats": false, + "p": 0.05 + }, + "ExpTransform": { + "retain_stats": false, + "p": 0.05 + }, + "SigmoidTransform": { + "retain_stats": false, + "p": 0.05 + }, + "HistogramEqualTransform": { + "retain_stats": false, + "p": 0.1 + }, + "RedistributeTransform": { + "in_seg": 0.2, + "retain_stats": false, + "p": 0.5 + }, + "ShapeTransform": { + "shape_min": 1, + "ignore_axes": [ + 1, + 2 + ], + "p": 0.4 + }, + "ArtifactTransform": { + "motion": true, + "ghosting": true, + "spike": true, + "bias_field": true, + "blur": true, + "noise": true, + "swap": false, + "random_pick": true, + "p": 0 + }, + "SpatialCustomTransform": { + "flip": true, + "affine": true, + "elastic": true, + "anisotropy": true, + "random_pick": true, + "p": 0 + }, + "SpatialTransform": { + "patch_center_dist_from_border": 0, + "random_crop": false, + "p_elastic_deform": 0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [ + 0.7, + 1.4 + ], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false, + "mode_seg": "nearest" + }, + "GaussianNoiseTransform": { + "noise_variance": [ + 0, + 0.1 + ], + "p_per_channel": 1, + "synchronize_channels": true, + "p": 0.1 + }, + "GaussianBlurTransform": { + "blur_sigma": [ + 0.5, + 1.0 + ], + "synchronize_channels": false, + "synchronize_axes": false, + "p_per_channel": 0.5, + "benchmark": true, + "p": 0.2 + }, + "MultiplicativeBrightnessTransform": { + "multiplier_range": [ + 0.75, + 1.25 + ], + "synchronize_channels": false, + "p_per_channel": 1, + "p": 0.15 + }, + "ContrastTransform": { + "contrast_range": [ + 0.75, + 1.25 + ], + "preserve_range": true, + "synchronize_channels": false, + "p_per_channel": 1, + "p": 0.15 + }, + "SimulateLowResolutionTransform": { + "scale": [ + 0.3, + 1 + ], + "synchronize_channels": true, + "synchronize_axes": false, + "ignore_axes": [], + "p_per_channel": 0.5, + "p": 0.2 + }, + "InvertedGammaTransform": { + "gamma": [ + 0.7, + 1.5 + ], + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "p": 0.1 + }, + "GammaTransform": { + "gamma": [ + 0.7, + 1.5 + ], + "p_invert_image": 0, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "p": 0.3 } } } diff --git a/smauglab/configs/transform_params_one-sequence-to-segment-them-all.json b/smauglab/configs/transform_params_one-sequence-to-segment-them-all.json index c037ff6..6d124c9 100755 --- a/smauglab/configs/transform_params_one-sequence-to-segment-them-all.json +++ b/smauglab/configs/transform_params_one-sequence-to-segment-them-all.json @@ -1,165 +1,230 @@ { - "ScharrTransform": { - "kernel_type": "Scharr", - "absolute": true, - "retain_stats": true, - "mix_prob": 0.50, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.25 - }, - "GaussianBlurTransform": { - "kernel_type": "GaussianBlur", - "sigma": 1.0, - "retain_stats": false, - "mix_prob": 0.00, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.20 - }, - "UnsharpMaskTransform": { - "kernel_type": "UnsharpMask", - "sigma": 1.0, - "unsharp_amount": 1.5, - "retain_stats": false, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "mix_prob": 0.50, - "probability": 0.25 - }, - "RandomConvTransform": { - "kernel_type": "RandConv", - "kernel_sizes": [3,5,7], - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "mix_prob": 0.50, - "probability": 0.20 - }, - "RedistributeSegTransform": { - "in_seg": 0.25, - "retain_stats": true, - "probability": 0.4 - }, - "GaussianNoiseTransform": { - "mean": 0.0, - "std": 1.0, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.1 - }, - "ClampTransform": { - "max_clamp_amount": 0.2, - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.00 - }, - "BrightnessTransform": { - "brightness_range": [0.75, 1.25], - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.15 - }, - "GammaTransform": { - "gamma_range": [0.7, 1.5], - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.30 - }, - "InvGammaTransform": { - "gamma_range": [0.7, 1.5], - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.10 - }, - "ContrastTransform": { - "contrast_range": [0.75, 1.25], - "retain_stats": false, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.15 - }, - "FunctionTransform": { - "retain_stats": true, - "in_seg": 0, - "out_seg": 0, - "mix_in_out": false, - "probability": 0.1 - }, - "InverseTransform": { - "retain_stats": true, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "mix_prob": 0.00, - "probability": 0.25 - }, - "HistogramEqualizationTransform": { - "retain_stats": true, - "in_seg": 0, - "out_seg": 0, - "mix_in_out": true, - "mix_prob": 0.60, - "probability": 0.25 - }, - "SimulateLowResTransform": { - "scale": [0.5, 1.0], - "crop": [1.0, 1.0], - "same_on_batch": false, - "probability": 0.25 - }, - "AcqTransform": { - "scale": [0.6, 1.0], - "crop": [1.0, 1.0], - "same_on_batch": false, - "probability": 0.00 - }, - "BiasFieldTransform": { - "retain_stats": true, - "coefficients": 0.2, - "in_seg": 0.0, - "out_seg": 0.0, - "mix_in_out": true, - "probability": 0.15 - }, - "FlipTransform": { - "flip_axis": [0], - "same_on_batch": false, - "keepdim": true, - "probability": 0.5 - }, - "AffineTransform": { - "degrees": 5, - "translate": [0.1, 0.1, 0.1], - "scale": [0.7, 1.4], - "shear": [-5, 5, -5, 5, -5, 5], - "resample": "bilinear", - "probability": 0.0 - }, - "nnUNetSpatialTransform": { - "patch_center_dist_from_border": 80, - "random_crop": false, - "p_elastic_deform": 0.0, - "p_rotation": 0.2, - "p_scaling": 0.2, - "scaling": [0.7, 1.4], - "p_synchronize_scaling_across_axes": 1, - "bg_style_seg_sampling": false - }, - "ZscoreNormalizationTransform": { - "probability": 0.00 + "GPU": { + "RandomFlipTransformGPU": { + "flip_axis": [ + 0 + ], + "same_on_batch": false, + "keepdim": true, + "p": 0.5 + }, + "RandomAffineGPU": { + "degrees": 5, + "translate": [ + 0.1, + 0.1, + 0.1 + ], + "scale": [ + 0.7, + 1.4 + ], + "shears": [ + -5, + 5, + -5, + 5, + -5, + 5 + ], + "resample": "bilinear", + "p": 0.0 + }, + "RandomInverseGPU": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.0, + "p": 0.25 + }, + "RandomHistogramEqualizationGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.6, + "p": 0.25 + }, + "RandomRedistributeSegGPU": { + "in_seg": 0.25, + "retain_stats": true, + "p": 0.4 + }, + "RandomScharrGPU": { + "absolute": true, + "retain_stats": true, + "mix_prob": 0.5, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.25 + }, + "RandomUnsharpMaskGPU": { + "sigma": 1.0, + "unsharp_amount": 1.5, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.5, + "p": 0.25 + }, + "RandomRandConvGPU": { + "kernel_sizes": [ + 3, + 5, + 7 + ], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.5, + "p": 0.2 + }, + "RandomClampGPU": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.0 + }, + "RandomGaussianNoiseGPU": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.1 + }, + "RandomGaussianBlurGPU": { + "sigma": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.2 + }, + "RandomBrightnessGPU": { + "brightness_range": [ + 0.75, + 1.25 + ], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.15 + }, + "RandomGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.3 + }, + "RandomInvGammaGPU": { + "gamma_range": [ + 0.7, + 1.5 + ], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.1 + }, + "RandomContrastGPU": { + "contrast_range": [ + 0.75, + 1.25 + ], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.15 + }, + "RandomLog1pGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomSqrtGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomSinGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomExpGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomSigmoidGPU": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "p": 0.1 + }, + "RandomLowResTransformGPU": { + "scale": [ + 0.5, + 1.0 + ], + "same_on_batch": false, + "p": 0.25 + }, + "RandomAcqTransformGPU": { + "scale": [ + 0.6, + 1.0 + ], + "same_on_batch": false, + "p": 0.0 + }, + "RandomBiasFieldGPU": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "p": 0.15 + }, + "ZscoreNormalizationGPU": { + "p": 0.0 + } + }, + "CPU": { + "SpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [ + 0.7, + 1.4 + ], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false, + "mode_seg": "nearest" + } } } diff --git a/smauglab/transforms/build.py b/smauglab/transforms/build.py new file mode 100644 index 0000000..c3ffac0 --- /dev/null +++ b/smauglab/transforms/build.py @@ -0,0 +1,173 @@ +"""Build an augmentation pipeline from a config section, using the registry. + +This replaces four hand-written `if` ladders -- one in `gpu/transforms.py`, two in +`gpu/transforms_list.py`, one in `cpu/transforms.py` -- that between them repeated +the same ~900 lines of dispatch and had already drifted apart. Each ladder decided +three things implicitly that are now explicit registry data: which class a key maps +to (`entry.cls`), where it sits in the pipeline (`entry.order`), and whether it runs +in sequence or inside a shuffled bucket (`entry.group` / `force_sequential`). + +Validation is strict and cumulative: an unregistered name, an unaccepted parameter +or a missing required one are all collected and raised together, so a bad config is +fixed in one pass. +""" + +from __future__ import annotations + +from typing import Any + +from smauglab import registry +from smauglab.config import NON_AUGMENTATION_KEYS, OrderSource, PipelineMode, validate_section +from smauglab.registry import AugEntry, AugType, Backend, InvalidConfigError + + +def _instantiate(entry: AugEntry, params: dict, context: dict[str, Any]) -> Any: + """Build one transform, applying adapters and injecting runtime context.""" + kwargs = dict(params) + + # batchgeneratorsv2 ranges need wrapping in BGContrast, which samples differently + # from the bare tuple -- see AugEntry.param_adapters. + for name, adapter in entry.param_adapters.items(): + if name in kwargs: + kwargs[name] = adapter(tuple(kwargs[name])) + + for name in entry.context_params: + if name in context: + kwargs[name] = context[name] + + if entry.backend is Backend.CPU and entry.wrap_random: + # The probability lives on the wrapper, not the transform. + from batchgeneratorsv2.transforms.utils.random import RandomTransform + + probability = kwargs.pop("p", 1.0) + return RandomTransform(entry.cls(**kwargs), apply_probability=probability) + + return entry.cls(**kwargs) + + +def build_transforms( + section: dict, + backend: Backend, + *, + context: dict[str, Any] | None = None, + source: str = "", + order_source: OrderSource = OrderSource.REGISTRY, +) -> list[tuple[Any, AugEntry]]: + """Instantiate every augmentation in the section, in pipeline order. + + Order comes from `registry.PIPELINE_ORDER` by default rather than from the order + of keys in the file: the two have never agreed, and honouring the file silently + reorders a pipeline the moment someone tidies a config. `OrderSource.CONFIG` asks + for key order explicitly -- see `pipeline.order` in smauglab/config.py. + """ + problems = validate_section(section, backend, source=source) + if problems: + raise InvalidConfigError(source, problems) + + context = context or {} + built = [] + for name, params in section.items(): + if name.startswith(NON_AUGMENTATION_KEYS): + continue + entry = registry.get(name, backend) + built.append((_instantiate(entry, params, context), entry)) + if order_source is OrderSource.CONFIG: + return built + return sorted(built, key=lambda pair: registry.pipeline_position(pair[1])) + + +def _buckets(built: list[tuple[Any, AugEntry]], *, hoist_sequential: bool) -> tuple[list, list, list]: + """Split into (sequential, transfer, general-enhancement). + + Geometry always leads, in order. `force_sequential` means "never inside the GE + bucket" and so only bites when there *is* one: with both groups bucketed, + `RandomLowResTransformGPU` is hoisted up front alongside the geometry, but when + only the transfer group is bucketed it stays in its ordinary GE position. That + is exactly what the two hand-written pipelines did, and the difference is + invisible unless you line their two ladders up side by side. + """ + sequential, transfer, enhancement = [], [], [] + for transform, entry in built: + if entry.group is AugType.GEO or (hoist_sequential and entry.force_sequential): + sequential.append(transform) + elif entry.group is AugType.TA: + transfer.append(transform) + else: + enhancement.append(transform) + return sequential, transfer, enhancement + + +def build_gpu_pipeline( + section: dict, + *, + mode: PipelineMode = PipelineMode.SEQUENTIAL, + options: dict[str, Any] | None = None, + source: str = "", + order_source: OrderSource = OrderSource.REGISTRY, +) -> list[Any]: + """The GPU transform list for a given pipeline mode.""" + built = build_transforms(section, Backend.GPU, source=source, order_source=order_source) + if mode is PipelineMode.SEQUENTIAL: + return [transform for transform, _ in built] + + from smauglab.transforms.gpu.transforms_list import RandomChooseXTransformsGPU + + options = options or {} + sequential, transfer, enhancement = _buckets(built, hoist_sequential=mode is PipelineMode.RANDOM_ORDER) + + out = list(sequential) + out.append( + RandomChooseXTransformsGPU( + transforms_list=transfer, + num_transforms=len(transfer), + p=options.get("ta_probability", 1.0), + random_order=options.get("ta_random_order", True) if mode is PipelineMode.RANDOM_ORDER else False, + ) + ) + if mode is PipelineMode.RANDOM_ORDER: + out.append( + RandomChooseXTransformsGPU( + transforms_list=enhancement, + num_transforms=len(enhancement), + p=options.get("ge_probability", 1.0), + random_order=options.get("ge_random_order", True), + ) + ) + else: + # RANDOM_ORDER_TA shuffles only the transfer augmentations; the general + # enhancements stay in pipeline order, as they always have. + out.extend(enhancement) + return out + + +def build_cpu_pipeline( + section: dict, + *, + do_dummy_2d_data_aug: bool, + patch_size: Any, + rotation: Any, + source: str = "", + order_source: OrderSource = OrderSource.REGISTRY, +) -> list[Any]: + """The CPU transform list, with nnU-Net's runtime context injected. + + `SpatialTransform` is bracketed by the 2D/3D converters when dummy 2D + augmentation is on. Those converters are not augmentations and carry no registry + entry -- they are pipeline structure, emitted here around the slot. + """ + patch_size_spatial = patch_size[1:] if do_dummy_2d_data_aug else patch_size + context = {"patch_size": patch_size_spatial, "rotation": rotation} + built = build_transforms(section, Backend.CPU, context=context, source=source, order_source=order_source) + + if not do_dummy_2d_data_aug: + return [transform for transform, _ in built] + + from batchgeneratorsv2.transforms.utils.pseudo2d import Convert2DTo3DTransform, Convert3DTo2DTransform + + out: list[Any] = [] + for transform, entry in built: + if entry.name == "SpatialTransform": + out.extend([Convert3DTo2DTransform(), transform, Convert2DTo3DTransform()]) + else: + out.append(transform) + return out diff --git a/smauglab/transforms/cpu/contrast.py b/smauglab/transforms/cpu/contrast.py index 896f13b..51bdcb8 100644 --- a/smauglab/transforms/cpu/contrast.py +++ b/smauglab/transforms/cpu/contrast.py @@ -368,9 +368,3 @@ def _apply_to_image(self, img: torch.Tensor, **params) -> torch.Tensor: std = torch.std(img[c]) img[c] = (img[c] - mean) / torch.clamp(std, min=1e-8) return img - - -# Temporary bridge for the CPU `if` ladder, which passes kernel_type from the config. -# Removed with that ladder; see the note in gpu/contrast.py. -ConvTransform = _ConvBaseTransform -FunctionTransform = _FunctionBaseTransform diff --git a/smauglab/transforms/cpu/transforms.py b/smauglab/transforms/cpu/transforms.py index c99860b..df9b499 100644 --- a/smauglab/transforms/cpu/transforms.py +++ b/smauglab/transforms/cpu/transforms.py @@ -1,29 +1,29 @@ -import json -import os +"""The CPU augmentation pipeline, built from a config section via the registry. + +The ~250-line `if` ladder this replaces also read three values from outside the +config: `patch_size` and `rotation` come from nnU-Net at runtime (declared as +`context_params` on the registry entries), a top-level `retain_stats` was pushed +into several blocks, and `mode_seg="nearest"` was hardcoded. The first is injected +by the builder; the other two were folded into the configs by the `migration/` script. +""" + from typing import Union import numpy as np -import torch from batchgeneratorsv2.helpers.scalar_type import RandomScalar -from batchgeneratorsv2.transforms.intensity.brightness import MultiplicativeBrightnessTransform -from batchgeneratorsv2.transforms.intensity.contrast import BGContrast, ContrastTransform -from batchgeneratorsv2.transforms.intensity.gamma import GammaTransform -from batchgeneratorsv2.transforms.intensity.gaussian_noise import GaussianNoiseTransform -from batchgeneratorsv2.transforms.noise.gaussian_blur import GaussianBlurTransform -from batchgeneratorsv2.transforms.spatial.low_resolution import SimulateLowResolutionTransform -from batchgeneratorsv2.transforms.spatial.mirroring import MirrorTransform -from batchgeneratorsv2.transforms.spatial.spatial import SpatialTransform from batchgeneratorsv2.transforms.utils.compose import ComposeTransforms -from batchgeneratorsv2.transforms.utils.pseudo2d import Convert2DTo3DTransform, Convert3DTo2DTransform from batchgeneratorsv2.transforms.utils.random import RandomTransform -from smauglab.transforms.cpu.artifact import ArtifactTransform -from smauglab.transforms.cpu.contrast import FunctionTransform, HistogramEqualTransform, _ConvBaseTransform -from smauglab.transforms.cpu.fromSeg import RedistributeTransform -from smauglab.transforms.cpu.spatial import ShapeTransform, SpatialCustomTransform +from smauglab.config import load_config +from smauglab.registry import Backend +from smauglab.transforms.build import build_cpu_pipeline +from smauglab.transforms.cpu.contrast import ScharrConvTransform +from smauglab.transforms.cpu.spatial import SpatialCustomTransform class AugTransforms(ComposeTransforms): + """Dataloader-side augmentations, in registry order.""" + def __init__( self, json_path: str, @@ -32,279 +32,24 @@ def __init__( # tuples, so the one-element form was never what callers pass. patch_size: Union[np.ndarray, tuple[int, ...]], rotation_for_DA: RandomScalar, - # Accepted for signature compatibility with the nnU-Net trainers but - # unused -- the mirror axes are read from the JSON config instead, see - # _build_transforms below. Callers legitimately pass None. - mirror_axes: tuple[int, ...] | None, + # Accepted for signature compatibility with the nnU-Net trainers but unused: + # the mirror axes come from the config's MirrorTransform block, which is + # where the old builder read them from too (transform_params["mirror_axes"], + # never its own argument). + mirror_axes: tuple[int, ...] | None = None, ): - # Load transform parameters from JSON - config_path = os.path.join(json_path) - with open(config_path) as f: - config = json.load(f) - - if "CPU" in config.keys(): - self.transform_params = config["CPU"] - else: - self.transform_params = config - - self.transforms = self._build_transforms( - do_dummy_2d_data_aug=do_dummy_2d_data_aug, patch_size=patch_size, rotation_for_DA=rotation_for_DA, mirror_axes=mirror_axes + config = load_config(str(json_path)) + self.transform_params = config.section(Backend.CPU) + self.transforms = build_cpu_pipeline( + self.transform_params, + do_dummy_2d_data_aug=do_dummy_2d_data_aug, + patch_size=patch_size, + rotation=rotation_for_DA, + source=config.source, + order_source=config.order_source(), ) super().__init__(transforms=self.transforms) - def _build_transforms( - self, - do_dummy_2d_data_aug: bool, - patch_size: Union[np.ndarray, tuple[int, ...]], - rotation_for_DA: RandomScalar, - mirror_axes: tuple[int, ...] | None, - ): - transform_params = self.transform_params - transforms = [] - - # Scharr filter - conv_params = transform_params.get("_ConvBaseTransform") - if conv_params is not None: - transforms.append( - RandomTransform( - _ConvBaseTransform( - kernel_type=conv_params.get("kernel_type", "Scharr"), - absolute=conv_params.get("absolute", True), - retain_stats=transform_params.get("retain_stats", False), - ), - apply_probability=conv_params.get("probability", 0), - ) - ) - - # Apply functions - func_list = [ - lambda x: torch.log(1 + x), - torch.sqrt, - torch.sin, - torch.exp, - lambda x: 1 / (1 + torch.exp(-x)), - ] - func_params = transform_params.get("FunctionTransform") - if func_params is not None: - transforms.extend( - RandomTransform( - FunctionTransform(function=func, retain_stats=transform_params.get("retain_stats", False)), - apply_probability=func_params.get("probability", 0), - ) - for func in func_list - ) - - # Histogram manipulations - hist_params = transform_params.get("HistogramEqualTransform") - if hist_params is not None: - transforms.append( - RandomTransform( - HistogramEqualTransform(retain_stats=transform_params.get("retain_stats", False)), - apply_probability=hist_params.get("probability", 0), - ) - ) - - # Redistribute segmentation values - redist_params = transform_params.get("RedistributeTransform") - if redist_params is not None: - transforms.append( - RandomTransform( - RedistributeTransform(in_seg=redist_params.get("in_seg", 0), retain_stats=transform_params.get("retain_stats", False)), - apply_probability=redist_params.get("probability", 0), - ) - ) - - # Resolution transforms - shape_params = transform_params.get("ShapeTransform") - if shape_params is not None: - transforms.append( - RandomTransform( - ShapeTransform( - shape_min=shape_params.get("shape_min"), - ignore_axes=tuple(shape_params.get("ignore_axes", None)) - if shape_params.get("ignore_axes", None) is not None - else None, - ), - apply_probability=shape_params.get("probability", 0), - ) - ) - - # Artifacts generation - artifact_params = transform_params.get("ArtifactTransform") - if artifact_params is not None: - transforms.append( - RandomTransform( - ArtifactTransform( - motion=artifact_params.get("motion", False), - ghosting=artifact_params.get("ghosting", False), - spike=artifact_params.get("spike", False), - bias_field=artifact_params.get("bias_field", False), - blur=artifact_params.get("blur", False), - noise=artifact_params.get("noise", False), - swap=artifact_params.get("swap", False), - random_pick=artifact_params.get("random_pick", False), - ), - apply_probability=artifact_params.get("probability", 0), - ) - ) - - # Spatial transforms - spatial_custom_params = transform_params.get("SpatialCustomTransform") - if spatial_custom_params is not None: - transforms.append( - RandomTransform( - SpatialCustomTransform( - flip=spatial_custom_params.get("flip", False), - affine=spatial_custom_params.get("affine", False), - elastic=spatial_custom_params.get("elastic", False), - anisotropy=spatial_custom_params.get("anisotropy", False), - random_pick=spatial_custom_params.get("random_pick", False), - ), - apply_probability=spatial_custom_params.get("probability", 0), - ) - ) - - # Spatial nnunet transform - if do_dummy_2d_data_aug: - transforms.append(Convert3DTo2DTransform()) - patch_size_spatial = patch_size[1:] - else: - patch_size_spatial = patch_size - - spatial_params = transform_params.get("SpatialTransform") - if spatial_params is not None: - transforms.append( - SpatialTransform( - patch_size_spatial, - patch_center_dist_from_border=spatial_params.get("patch_center_dist_from_border", 0), - random_crop=spatial_params.get("random_crop", False), - p_elastic_deform=spatial_params.get("p_elastic_deform", 0), - p_rotation=spatial_params.get("p_rotation", 0), - rotation=rotation_for_DA, - p_scaling=spatial_params.get("p_scaling", 0), - scaling=spatial_params.get("scaling", (0.7, 1.4)), - p_synchronize_scaling_across_axes=spatial_params.get("p_synchronize_scaling_across_axes", 1), - bg_style_seg_sampling=spatial_params.get("bg_style_seg_sampling", False), - mode_seg="nearest", - ) - ) - - if do_dummy_2d_data_aug: - transforms.append(Convert2DTo3DTransform()) - - # Noise transforms - noise_params = transform_params.get("GaussianNoiseTransform") - if noise_params is not None: - transforms.append( - RandomTransform( - GaussianNoiseTransform( - noise_variance=tuple(noise_params.get("noise_variance", (0, 0.1))), - p_per_channel=noise_params.get("p_per_channel", 1), - synchronize_channels=noise_params.get("synchronize_channels", True), - ), - apply_probability=noise_params.get("probability", 0), - ) - ) - - # Gaussian blur - blur_params = transform_params.get("GaussianBlurTransform") - if blur_params is not None: - transforms.append( - RandomTransform( - GaussianBlurTransform( - blur_sigma=tuple(blur_params.get("blur_sigma", (0.5, 1.0))), - synchronize_channels=blur_params.get("synchronize_channels", False), - synchronize_axes=blur_params.get("synchronize_axes", False), - p_per_channel=blur_params.get("p_per_channel", 0.5), - benchmark=blur_params.get("benchmark", True), - ), - apply_probability=blur_params.get("probability", 0), - ) - ) - - # Brightness transforms - bright_params = transform_params.get("MultiplicativeBrightnessTransform") - if bright_params is not None: - transforms.append( - RandomTransform( - MultiplicativeBrightnessTransform( - multiplier_range=BGContrast(tuple(bright_params.get("multiplier_range", (0.75, 1.25)))), - synchronize_channels=bright_params.get("synchronize_channels", False), - p_per_channel=bright_params.get("p_per_channel", 1), - ), - apply_probability=bright_params.get("probability", 0), - ) - ) - - # Contrast transforms - contrast_params = transform_params.get("ContrastTransform") - if contrast_params is not None: - transforms.append( - RandomTransform( - ContrastTransform( - contrast_range=BGContrast(tuple(contrast_params.get("contrast_range", (0.75, 1.25)))), - preserve_range=contrast_params.get("preserve_range", True), - synchronize_channels=contrast_params.get("synchronize_channels", False), - p_per_channel=contrast_params.get("p_per_channel", 1), - ), - apply_probability=contrast_params.get("probability", 0), - ) - ) - - # Simulate low resolution - lowres_params = transform_params.get("SimulateLowResolutionTransform") - if lowres_params is not None: - transforms.append( - RandomTransform( - SimulateLowResolutionTransform( - scale=tuple(lowres_params.get("scale", (0.3, 1))), - synchronize_channels=lowres_params.get("synchronize_channels", True), - synchronize_axes=lowres_params.get("synchronize_axes", False), - ignore_axes=tuple(lowres_params.get("ignore_axes", ())), - allowed_channels=lowres_params.get("allowed_channels", None), - p_per_channel=lowres_params.get("p_per_channel", 0.5), - ), - apply_probability=lowres_params.get("probability", 0), - ) - ) - - # Gamma transforms - gamma_inv_params = transform_params.get("GammaTransform_invert") - if gamma_inv_params is not None: - transforms.append( - RandomTransform( - GammaTransform( - gamma=BGContrast(tuple(gamma_inv_params.get("gamma", (0.7, 1.5)))), - p_invert_image=gamma_inv_params.get("p_invert_image", 1), - synchronize_channels=gamma_inv_params.get("synchronize_channels", False), - p_per_channel=gamma_inv_params.get("p_per_channel", 1), - p_retain_stats=gamma_inv_params.get("p_retain_stats", 1), - ), - apply_probability=gamma_inv_params.get("probability", 0), - ) - ) - - gamma_params = transform_params.get("GammaTransform") - if gamma_params is not None: - transforms.append( - RandomTransform( - GammaTransform( - gamma=BGContrast(tuple(gamma_params.get("gamma", (0.7, 1.5)))), - p_invert_image=gamma_params.get("p_invert_image", 0), - synchronize_channels=gamma_params.get("synchronize_channels", False), - p_per_channel=gamma_params.get("p_per_channel", 1), - p_retain_stats=gamma_params.get("p_retain_stats", 1), - ), - apply_probability=gamma_params.get("probability", 0), - ) - ) - - # Mirroring transforms - if transform_params.get("mirror_axes") is not None and len(transform_params["mirror_axes"]) > 0: - transforms.append(MirrorTransform(allowed_axes=transform_params.get("mirror_axes"))) - - return transforms - class AugTransformsTest(ComposeTransforms): def __init__(self): @@ -317,10 +62,7 @@ def _build_transforms(self): # Scharr filter transforms.append( RandomTransform( - _ConvBaseTransform( - kernel_type="Scharr", - absolute=True, - ), + ScharrConvTransform(absolute=True), apply_probability=0.9, ) ) diff --git a/smauglab/transforms/gpu/contrast.py b/smauglab/transforms/gpu/contrast.py index 61ee817..059e01c 100644 --- a/smauglab/transforms/gpu/contrast.py +++ b/smauglab/transforms/gpu/contrast.py @@ -1635,15 +1635,3 @@ def apply_transform( input[:, c] = checked return input - - -# --- temporary bridges for the hand-written pipelines ------------------------------ -# -# The three `if` ladders in gpu/transforms.py, gpu/transforms_list.py and -# cpu/transforms.py still read `kernel_type` and `func` out of the config and pass them -# in, which is exactly the dispatch the leaf classes above exist to remove. They are -# replaced by the registry-driven builder later in this series; until then these -# aliases keep them working without a second rewrite. Do not use them in new code. -RandomConvTransformGPU = _RandomConvBaseGPU -RandomFunctionGPU = _RandomFunctionBaseGPU -_RandomGammaWithInvertGPU = _RandomGammaBaseGPU diff --git a/smauglab/transforms/gpu/transforms.py b/smauglab/transforms/gpu/transforms.py index 4424ce6..49fb4a7 100644 --- a/smauglab/transforms/gpu/transforms.py +++ b/smauglab/transforms/gpu/transforms.py @@ -1,506 +1,30 @@ -import json -import os -from typing import Any - -import numpy as np -import torch -from torch import Tensor, nn - -from smauglab.transforms.gpu.base import AugmentationSequentialCustom, ImageOnlyTransform, TransformType -from smauglab.transforms.gpu.contrast import ( - RandomBiasFieldGPU, - RandomBrightnessGPU, - RandomClampGPU, - RandomContrastGPU, - RandomConvTransformGPU, - RandomFunctionGPU, - RandomGaussianNoiseGPU, - RandomHistogramEqualizationGPU, - RandomInverseGPU, - ZscoreNormalizationGPU, - _RandomGammaWithInvertGPU, -) -from smauglab.transforms.gpu.domain_transfer import RandomDomainTransferGPU -from smauglab.transforms.gpu.fromSeg import RandomPaletteGPU, RandomRedistributeSegGPU -from smauglab.transforms.gpu.spatial import ( - RandomAcqTransformGPU, - RandomAffineGPU, - RandomCropTransformGPU, - RandomFlipTransformGPU, - RandomLowResTransformGPU, -) -from smauglab.transforms.synthseg.transforms import RandomSynthSegGPU +from smauglab.config import PipelineMode, load_config +from smauglab.registry import Backend +from smauglab.transforms.build import build_gpu_pipeline +from smauglab.transforms.gpu.base import AugmentationSequentialCustom class AugTransformsGPU(AugmentationSequentialCustom): - """ - Module to perform data augmentation on GPU. - """ - - def __init__(self, json_path: str): - # Load transform parameters from JSON - config_path = os.path.join(json_path) - with open(config_path) as f: - config = json.load(f) - - if "GPU" in config.keys(): - self.transform_params = config["GPU"] - else: - self.transform_params = config - - transforms = self._build_transforms() - super().__init__( - *transforms, data_keys=["input", "mask"], same_on_batch=True - ) # Same_on_batch to ensure mask are aligned with images correctly (custom) see AugmentationSequentialOpsCustom in base.py - - def _build_transforms(self) -> list[TransformType]: - # Annotated rather than inferred: an empty list takes its element type from - # the first append, which would pin it to whichever transform the config - # happens to enable first and reject every sibling appended after it. - transforms: list[TransformType] = [] - - # Flipping transforms - flip_params = self.transform_params.get("FlipTransform") - if flip_params is not None: - transforms.append( - RandomFlipTransformGPU( - flip_axis=flip_params.get("flip_axis", [0]), - p=flip_params.get("probability", 0), - same_on_batch=flip_params.get("same_on_batch", False), - keepdim=flip_params.get("keepdim", True), - ) - ) - - # Spatial transforms - affine_params = self.transform_params.get("AffineTransform") - if affine_params is not None: - transforms.append( - RandomAffineGPU( - degrees=affine_params.get("degrees", 10), - translate=affine_params.get("translate", [0.1, 0.1, 0.1]), - scale=affine_params.get("scale", [0.9, 1.1]), - shears=affine_params.get("shear", [-10, 10, -10, 10, -10, 10]), - resample=affine_params.get("resample", "bilinear"), - p=affine_params.get("probability", 0), - ) - ) - - # SynthSeg generative augmentation: replace the image with a GMM synthesis - # of the segmentation (intensity-only here, so the mask stays consistent; - # geometric transforms above deform the labels first). All SynthSeg - # generator parameters are read straight from the config block. - synthseg_params = self.transform_params.get("SynthSeg") - if synthseg_params is not None: - synthseg_kwargs = {k: v for k, v in synthseg_params.items() if k != "probability"} - transforms.append( - RandomSynthSegGPU( - p=synthseg_params.get("probability", 1.0), - **synthseg_kwargs, - ) - ) - - ## Transfer augmentations (TA) - ######################### - # Replace image with V26_6_2 contrast (K-means + Voronoi + per-label remap) - palette_params = self.transform_params.get("RandomPALETTETransform") - if palette_params is not None: - transforms.append( - RandomPaletteGPU( - p=palette_params.get("probability", 1.0), - c_choices=palette_params.get("c_choices", [2, 3, 4, 5, 6]), - s_choices=palette_params.get("s_choices", [2, 3, 4, 5, 6, 7, 8, 9, 10]), - blur_sigmas=palette_params.get("blur_sigmas", [0.0, 0.0, 0.0, 0.3, 0.5, 0.8]), - dark_threshold=palette_params.get("dark_threshold", 0.01), - n_kmeans_subsample=palette_params.get("n_kmeans_subsample", 10000), - skip_parcellation_prob=palette_params.get("skip_parcellation_prob", 0.10), - skip_sub_parc_prob=palette_params.get("skip_sub_parc_prob", 0.40), - alpha_magnitude_range=palette_params.get("alpha_magnitude_range", [0.5, 2.0]), - label_remap_prob=palette_params.get("label_remap_prob", 0.5), - min_label_voxels=palette_params.get("min_label_voxels", 4), - label_classes=palette_params.get("label_classes", None), - ) - ) - - # Domain transfer: randomly re-render the image as another sequence/cluster (TA) - # Accept either the class-name key or the descriptive key. - domain_params = self.transform_params.get("RandomDomainTransferGPU") or self.transform_params.get("DomainTransferTransform") - if domain_params is not None: - transforms.append( - RandomDomainTransferGPU( - bank_path=domain_params.get("bank_path", None), - source_label=domain_params["source_label"], - targets=domain_params.get("targets", None), - include_self=domain_params.get("include_self", False), - any_source=domain_params.get("any_source", False), - sigma=domain_params.get("sigma", 2.0), - apply_to_channel=domain_params.get("apply_to_channel", [0]), - zscore_io=domain_params.get("zscore_io", "auto"), - pct=domain_params.get("pct", 1.0), - blend_targets=domain_params.get("blend_targets", 1), - blend_concentration=domain_params.get("blend_concentration", 1.0), - p_class_mix=domain_params.get("p_class_mix", 0.0), - bias_field_std=domain_params.get("bias_field_std", 0.0), - bias_scale=domain_params.get("bias_scale", 0.03), - p_spatial_mix=domain_params.get("p_spatial_mix", 0.0), - spatial_mix_scale=domain_params.get("spatial_mix_scale", 0.03), - spatial_mix_gain=domain_params.get("spatial_mix_gain", 3.0), - p=domain_params.get("probability", 0.0), - same_on_batch=domain_params.get("same_on_batch", False), - ) - ) - - # Inverse transform (max - pixel_value) - inverse_params = self.transform_params.get("InverseTransform") - if inverse_params is not None: - transforms.append( - RandomInverseGPU( - p=inverse_params.get("probability", 0), - in_seg=inverse_params.get("in_seg", 0.0), - out_seg=inverse_params.get("out_seg", 0.0), - mix_in_out=inverse_params.get("mix_in_out", False), - mix_prob=inverse_params.get("mix_prob", 0.0), - retain_stats=inverse_params.get("retain_stats", False), - ) - ) - - # Histogram manipulations - histo_params = self.transform_params.get("HistogramEqualizationTransform") - if histo_params is not None: - transforms.append( - RandomHistogramEqualizationGPU( - p=histo_params.get("probability", 0), - in_seg=histo_params.get("in_seg", 0.0), - out_seg=histo_params.get("out_seg", 0.0), - mix_in_out=histo_params.get("mix_in_out", False), - mix_prob=histo_params.get("mix_prob", 0.0), - retain_stats=histo_params.get("retain_stats", False), - ) - ) - - # Redistribute segmentation values transform - redistribute_params = self.transform_params.get("RedistributeSegTransform") - if redistribute_params is not None: - transforms.append( - RandomRedistributeSegGPU( - in_seg=redistribute_params.get("in_seg", 0.2), - retain_stats=redistribute_params.get("retain_stats", False), - p=redistribute_params.get("probability", 0), - std_noise_range=redistribute_params.get("std_noise_range", [0.1, 0.3]), - dilation_iterations_range=redistribute_params.get("dilation_iterations_range", [1, 3]), - ) - ) - - # Scharr filter - scharr_params = self.transform_params.get("ScharrTransform") - if scharr_params is not None: - transforms.append( - RandomConvTransformGPU( - kernel_type=scharr_params.get("kernel_type", "Scharr"), - p=scharr_params.get("probability", 0), - in_seg=scharr_params.get("in_seg", 0.0), - out_seg=scharr_params.get("out_seg", 0.0), - mix_in_out=scharr_params.get("mix_in_out", False), - retain_stats=scharr_params.get("retain_stats", True), - absolute=scharr_params.get("absolute", True), - mix_prob=scharr_params.get("mix_prob", 0.0), - ) - ) - - # Unsharp masking - unsharp_params = self.transform_params.get("UnsharpMaskTransform") - if unsharp_params is not None: - transforms.append( - RandomConvTransformGPU( - kernel_type=unsharp_params.get("kernel_type", "UnsharpMask"), - p=unsharp_params.get("probability", 0), - in_seg=unsharp_params.get("in_seg", 0.0), - out_seg=unsharp_params.get("out_seg", 0.0), - mix_in_out=unsharp_params.get("mix_in_out", False), - sigma=unsharp_params.get("sigma", 1.0), - unsharp_amount=unsharp_params.get("unsharp_amount", 1.5), - mix_prob=unsharp_params.get("mix_prob", 0.0), - ) - ) - - # RandomConv transform - randconv_params = self.transform_params.get("RandomConvTransform") - if randconv_params is not None: - transforms.append( - RandomConvTransformGPU( - kernel_type=randconv_params.get("kernel_type", "RandConv"), - p=randconv_params.get("probability", 0), - in_seg=randconv_params.get("in_seg", 0.0), - out_seg=randconv_params.get("out_seg", 0.0), - mix_in_out=randconv_params.get("mix_in_out", False), - retain_stats=randconv_params.get("retain_stats", False), - kernel_sizes=randconv_params.get("kernel_sizes", [1, 3, 5, 7]), - mix_prob=randconv_params.get("mix_prob", 0.0), - ) - ) - - ## General enhancement (GE) - # Clamping transform - clamp_params = self.transform_params.get("ClampTransform") - if clamp_params is not None: - transforms.append( - RandomClampGPU( - max_clamp_amount=clamp_params.get("max_clamp_amount", 0.0), - in_seg=clamp_params.get("in_seg", 0.0), - out_seg=clamp_params.get("out_seg", 0.0), - mix_in_out=clamp_params.get("mix_in_out", False), - retain_stats=clamp_params.get("retain_stats", False), - p=clamp_params.get("probability", 0), - ) - ) - - # Noise transforms - noise_params = self.transform_params.get("GaussianNoiseTransform") - if noise_params is not None: - transforms.append( - RandomGaussianNoiseGPU( - mean=noise_params.get("mean", 0.0), - std=noise_params.get("std", 1.0), - in_seg=noise_params.get("in_seg", 0.0), - out_seg=noise_params.get("out_seg", 0.0), - mix_in_out=noise_params.get("mix_in_out", False), - p=noise_params.get("probability", 0), - ) - ) - - # Gaussian blur - gaussianblur_params = self.transform_params.get("GaussianBlurTransform") - if gaussianblur_params is not None: - transforms.append( - RandomConvTransformGPU( - kernel_type=gaussianblur_params.get("kernel_type", "GaussianBlur"), - in_seg=gaussianblur_params.get("in_seg", 0.0), - out_seg=gaussianblur_params.get("out_seg", 0.0), - mix_in_out=gaussianblur_params.get("mix_in_out", False), - p=gaussianblur_params.get("probability", 0), - sigma=gaussianblur_params.get("sigma", 1.0), - ) - ) - - # Brightness transforms - brightness_params = self.transform_params.get("BrightnessTransform") - if brightness_params is not None: - transforms.append( - RandomBrightnessGPU( - brightness_range=brightness_params.get("brightness_range", [0.5, 1.5]), - in_seg=brightness_params.get("in_seg", 0.0), - out_seg=brightness_params.get("out_seg", 0.0), - mix_in_out=brightness_params.get("mix_in_out", False), - p=brightness_params.get("probability", 0), - ) - ) - - # Gamma transforms - gamma_params = self.transform_params.get("GammaTransform") - if gamma_params is not None: - transforms.append( - _RandomGammaWithInvertGPU( - gamma_range=gamma_params.get("gamma_range", [0.7, 1.5]), - p=gamma_params.get("probability", 0), - invert_image=False, - in_seg=gamma_params.get("in_seg", 0.0), - out_seg=gamma_params.get("out_seg", 0.0), - mix_in_out=gamma_params.get("mix_in_out", False), - retain_stats=gamma_params.get("retain_stats", False), - ) - ) - - inv_gamma_params = self.transform_params.get("InvGammaTransform") - if inv_gamma_params is not None: - transforms.append( - _RandomGammaWithInvertGPU( - gamma_range=inv_gamma_params.get("gamma_range", [0.7, 1.5]), - p=inv_gamma_params.get("probability", 0), - in_seg=inv_gamma_params.get("in_seg", 0.0), - out_seg=inv_gamma_params.get("out_seg", 0.0), - mix_in_out=inv_gamma_params.get("mix_in_out", False), - invert_image=True, - retain_stats=inv_gamma_params.get("retain_stats", False), - ) - ) + """GPU augmentation pipeline, built from a config section via the registry. - # nnUNetV2 Contrast transforms - contrast_params = self.transform_params.get("ContrastTransform") - if contrast_params is not None: - transforms.append( - RandomContrastGPU( - contrast_range=contrast_params.get("contrast_range", [0.75, 1.25]), - p=contrast_params.get("probability", 0), - in_seg=contrast_params.get("in_seg", 0.0), - out_seg=contrast_params.get("out_seg", 0.0), - mix_in_out=contrast_params.get("mix_in_out", False), - retain_stats=contrast_params.get("retain_stats", False), - ) - ) - - # Apply functions - func_list = [ - lambda x: torch.log(1 + x), - torch.sqrt, - torch.sin, - torch.exp, - lambda x: 1 / (1 + torch.exp(-x)), - ] - function_params = self.transform_params.get("FunctionTransform") - if function_params is not None: - transforms.extend( - RandomFunctionGPU( - func=func, - p=function_params.get("probability", 0), - in_seg=function_params.get("in_seg", 0.0), - out_seg=function_params.get("out_seg", 0.0), - mix_in_out=function_params.get("mix_in_out", False), - retain_stats=function_params.get("retain_stats", False), - ) - for func in func_list - ) - - # Shape transforms (Cropping and Simulating low resolution) - lowres_params = self.transform_params.get("SimulateLowResTransform") - if lowres_params is not None: - transforms.append( - RandomLowResTransformGPU( - p=lowres_params.get("probability", 0), - scale=lowres_params.get("scale", [0.3, 1.0]), - same_on_batch=lowres_params.get("same_on_batch", False), - ) - ) - - acq_params = self.transform_params.get("AcqTransform") - if acq_params is not None: - transforms.append( - RandomAcqTransformGPU( - p=acq_params.get("probability", 0), - scale=acq_params.get("scale", [0.3, 1.0]), - same_on_batch=acq_params.get("same_on_batch", False), - ) - ) - - crop_params = self.transform_params.get("CropTransform") - if crop_params is not None: - transforms.append( - RandomCropTransformGPU( - p=crop_params.get("probability", 0), - crop=crop_params.get("crop", [1.0, 1.0]), - pos=crop_params.get("pos", [0.0, 1.0]), - same_on_batch=acq_params.get("same_on_batch", False), - ) - ) - - # Bias field artifact - bias_field_params = self.transform_params.get("BiasFieldTransform") - if bias_field_params is not None: - transforms.append( - RandomBiasFieldGPU( - p=bias_field_params.get("probability", 0), - in_seg=bias_field_params.get("in_seg", 0.0), - out_seg=bias_field_params.get("out_seg", 0.0), - mix_in_out=bias_field_params.get("mix_in_out", False), - retain_stats=bias_field_params.get("retain_stats", False), - coefficients=bias_field_params.get("coefficients", 0.5), - ) - ) - - ## Random Z-score normalization - zscore_params = self.transform_params.get("ZscoreNormalizationTransform") - if zscore_params is not None: - transforms.append(ZscoreNormalizationGPU(p=zscore_params.get("probability", 0))) - - return transforms - - -class RandomChooseXTransformsGPU(ImageOnlyTransform): - """Randomly choose X transforms to apply from a given list of ImageOnlyTransform transforms (GPU version). - - Args: - transforms_list: List of initialized ImageOnlyTransform to choose from. - num_transforms: Number of transforms to randomly select and apply. - same_on_batch: apply the same transformation across the batch. - p: probability for applying the X transforms to a batch. This param controls the augmentation - probabilities batch-wise. - keepdim: whether to keep the output shape the same as input ``True`` or broadcast it to the batch - form ``False``. - - """ - - def __init__( - self, - transforms_list: list[ImageOnlyTransform], - num_transforms: int = 1, - same_on_batch: bool = False, - p: float = 1.0, - keepdim: bool = True, - **kwargs, - ) -> None: - super().__init__(p=p, same_on_batch=same_on_batch, keepdim=keepdim) - if not isinstance(num_transforms, int) or num_transforms < 0: - raise ValueError(f"num_transforms must be a non-negative int. Got {num_transforms!r}.") - self.transforms_list = nn.ModuleList(transforms_list) - self.num_transforms = num_transforms - - def _apply_mix(self, x: Tensor, seg: Tensor | None) -> Tensor: - if self.num_transforms == 0 or len(self.transforms_list) == 0: - return x - - k = min(self.num_transforms, len(self.transforms_list)) - # sample without replacement - idx = torch.randperm(len(self.transforms_list), device=x.device)[:k] - - child_params: dict[str, Tensor] = {} - if seg is not None: - child_params["seg"] = seg - - for j in idx.tolist(): - t = self.transforms_list[j] - if torch.rand(1, device=x.device, dtype=x.dtype) > t.p: - continue - if not hasattr(t, "apply_transform"): - raise TypeError(f"All transforms must implement apply_transform like ImageOnlyTransform. Got {type(t)}") - # Most contrast transforms perform their random sampling inside apply_transform. - t_flags = getattr(t, "flags", {}) - x = t.apply_transform(x, child_params, t_flags, transform=None) - return x - - @torch.no_grad() # disable gradients for efficiency - def apply_transform(self, input: Tensor, params: dict[str, Tensor], flags: dict[str, Any], transform: Tensor | None = None) -> Tensor: - seg = params.get("seg") - - if self.same_on_batch: - return self._apply_mix(input, seg) - - batch_size = input.shape[0] - out = input - for i in range(batch_size): - xi = out[i : i + 1] - seg_i = None - seg_i = seg[i : i + 1] if seg is not None and isinstance(seg, torch.Tensor) and seg.shape[0] == batch_size else seg - xi = self._apply_mix(xi, seg_i) - out[i : i + 1] = xi - return out - - -def normalize(arr: np.ndarray) -> np.ndarray: - """ - Normalize a tensor to the range [0, 1]. + The ~370-line `if` ladder this replaces decided the class, the parameters and + the pipeline position of every augmentation inline; all three now come from the + registry, and `smauglab.transforms.build` does the dispatch once for all three + GPU pipeline modes. """ - min_val = np.min(arr) - max_val = np.max(arr) - normalized_arr = (arr - min_val) / (max_val - min_val + 1e-8) - return normalized_arr + mode: PipelineMode = PipelineMode.SEQUENTIAL -def pad_numpy_array(arr, shape): - """ - Pad a numpy array to the desired shape with zeros. - """ - # Calculate padding needed for each dimension - pad_width = [ - (max(0, shape[i] - arr.shape[i]) // 2, max(0, shape[i] - arr.shape[i]) - max(0, shape[i] - arr.shape[i]) // 2) - for i in range(len(shape)) - ] - padded_arr = np.pad(arr, pad_width, mode="constant", constant_values=0) - return padded_arr + def __init__(self, json_path: str): + config = load_config(str(json_path)) + self.transform_params = config.section(Backend.GPU) + transforms = build_gpu_pipeline( + self.transform_params, + mode=self.mode, + options=config.pipeline_options("random_choose"), + source=config.source, + order_source=config.order_source(), + ) + # same_on_batch keeps the mask aligned with the image; see + # AugmentationSequentialOpsCustom in base.py. + super().__init__(*transforms, data_keys=["input", "mask"], same_on_batch=True) diff --git a/smauglab/transforms/gpu/transforms_list.py b/smauglab/transforms/gpu/transforms_list.py index 1f64f7c..71c6574 100644 --- a/smauglab/transforms/gpu/transforms_list.py +++ b/smauglab/transforms/gpu/transforms_list.py @@ -1,668 +1,33 @@ -import json -import os +"""The random-order GPU pipelines, and the combinator they are built from. + +`AugTransformsGPURandomOrder` and `AugTransformsGPURandomOrderTA` used to carry a +near-verbatim copy each of the ~300-line dispatch ladder in `transforms.py`, which +had already drifted from it (they passed a `crop=` argument no transform accepts, +and ordered SimulateLowRes differently). Both are now three lines: the only thing +that distinguishes them from `AugTransformsGPU` is how the registry's TA and GE +groups get bucketed, which `smauglab.transforms.build` handles. +""" + from typing import Any -import numpy as np import torch from torch import Tensor, nn -from smauglab.transforms.gpu.base import AugmentationSequentialCustom, ImageOnlyTransform, TransformType -from smauglab.transforms.gpu.contrast import ( - RandomBiasFieldGPU, - RandomBrightnessGPU, - RandomClampGPU, - RandomContrastGPU, - RandomConvTransformGPU, - RandomFunctionGPU, - RandomGaussianNoiseGPU, - RandomHistogramEqualizationGPU, - RandomInverseGPU, - ZscoreNormalizationGPU, - _RandomGammaWithInvertGPU, -) -from smauglab.transforms.gpu.fromSeg import RandomRedistributeSegGPU -from smauglab.transforms.gpu.spatial import RandomAcqTransformGPU, RandomAffineGPU, RandomFlipTransformGPU, RandomLowResTransformGPU - - -class AugTransformsGPURandomOrder(AugmentationSequentialCustom): - """ - Module to perform data augmentation on GPU. - """ - - def __init__(self, json_path: str): - # Load transform parameters from JSON - config_path = os.path.join(json_path) - with open(config_path) as f: - config = json.load(f) - - if "GPU" in config.keys(): - self.transform_params = config["GPU"] - else: - self.transform_params = config - - transforms = self._build_transforms() - super().__init__( - *transforms, data_keys=["input", "mask"], same_on_batch=True - ) # Same_on_batch to ensure mask are aligned with images correctly (custom) see AugmentationSequentialOpsCustom in base.py - - def _build_transforms(self) -> list[TransformType]: - # Annotated rather than inferred: an empty list takes its element type from - # the first append, which would pin it to whichever transform the config - # happens to enable first and reject every sibling appended after it. - transforms: list[TransformType] = [] - - # Flipping transforms - flip_params = self.transform_params.get("FlipTransform") - if flip_params is not None: - transforms.append( - RandomFlipTransformGPU( - flip_axis=flip_params.get("flip_axis", [0]), - p=flip_params.get("probability", 0), - same_on_batch=flip_params.get("same_on_batch", False), - keepdim=flip_params.get("keepdim", True), - ) - ) - - # Spatial transforms - affine_params = self.transform_params.get("AffineTransform") - if affine_params is not None: - transforms.append( - RandomAffineGPU( - degrees=affine_params.get("degrees", 10), - translate=affine_params.get("translate", [0.1, 0.1, 0.1]), - scale=affine_params.get("scale", [0.9, 1.1]), - shears=affine_params.get("shear", [-10, 10, -10, 10, -10, 10]), - resample=affine_params.get("resample", "bilinear"), - p=affine_params.get("probability", 0), - ) - ) - - ## Transfer augmentations (TA) - ta_transforms: list[ImageOnlyTransform] = [] - # Inverse transform (max - pixel_value) - inverse_params = self.transform_params.get("InverseTransform") - if inverse_params is not None: - ta_transforms.append( - RandomInverseGPU( - p=inverse_params.get("probability", 0), - in_seg=inverse_params.get("in_seg", 0.0), - out_seg=inverse_params.get("out_seg", 0.0), - mix_in_out=inverse_params.get("mix_in_out", False), - mix_prob=inverse_params.get("mix_prob", 0.0), - retain_stats=inverse_params.get("retain_stats", False), - ) - ) - - # Histogram manipulations - histo_params = self.transform_params.get("HistogramEqualizationTransform") - if histo_params is not None: - ta_transforms.append( - RandomHistogramEqualizationGPU( - p=histo_params.get("probability", 0), - in_seg=histo_params.get("in_seg", 0.0), - out_seg=histo_params.get("out_seg", 0.0), - mix_in_out=histo_params.get("mix_in_out", False), - mix_prob=histo_params.get("mix_prob", 0.0), - retain_stats=histo_params.get("retain_stats", False), - ) - ) - - # Redistribute segmentation values transform - redistribute_params = self.transform_params.get("RedistributeSegTransform") - if redistribute_params is not None: - ta_transforms.append( - RandomRedistributeSegGPU( - in_seg=redistribute_params.get("in_seg", 0.2), - retain_stats=redistribute_params.get("retain_stats", False), - p=redistribute_params.get("probability", 0), - ) - ) - - # Scharr filter - scharr_params = self.transform_params.get("ScharrTransform") - if scharr_params is not None: - ta_transforms.append( - RandomConvTransformGPU( - kernel_type=scharr_params.get("kernel_type", "Scharr"), - p=scharr_params.get("probability", 0), - in_seg=scharr_params.get("in_seg", 0.0), - out_seg=scharr_params.get("out_seg", 0.0), - mix_in_out=scharr_params.get("mix_in_out", False), - retain_stats=scharr_params.get("retain_stats", True), - absolute=scharr_params.get("absolute", True), - mix_prob=scharr_params.get("mix_prob", 0.0), - ) - ) - - # Unsharp masking - unsharp_params = self.transform_params.get("UnsharpMaskTransform") - if unsharp_params is not None: - ta_transforms.append( - RandomConvTransformGPU( - kernel_type=unsharp_params.get("kernel_type", "UnsharpMask"), - p=unsharp_params.get("probability", 0), - in_seg=unsharp_params.get("in_seg", 0.0), - out_seg=unsharp_params.get("out_seg", 0.0), - mix_in_out=unsharp_params.get("mix_in_out", False), - sigma=unsharp_params.get("sigma", 1.0), - unsharp_amount=unsharp_params.get("unsharp_amount", 1.5), - mix_prob=unsharp_params.get("mix_prob", 0.0), - ) - ) - - # RandomConv transform - randconv_params = self.transform_params.get("RandomConvTransform") - if randconv_params is not None: - ta_transforms.append( - RandomConvTransformGPU( - kernel_type=randconv_params.get("kernel_type", "RandConv"), - p=randconv_params.get("probability", 0), - in_seg=randconv_params.get("in_seg", 0.0), - out_seg=randconv_params.get("out_seg", 0.0), - mix_in_out=randconv_params.get("mix_in_out", False), - retain_stats=randconv_params.get("retain_stats", False), - kernel_sizes=randconv_params.get("kernel_sizes", [1, 3, 5, 7]), - mix_prob=randconv_params.get("mix_prob", 0.0), - ) - ) - - # Apply functions - func_list = [ - lambda x: torch.log(1 + x), - torch.sqrt, - torch.sin, - torch.exp, - lambda x: 1 / (1 + torch.exp(-x)), - ] - function_params = self.transform_params.get("FunctionTransform") - if function_params is not None: - ta_transforms.extend( - RandomFunctionGPU( - func=func, - p=function_params.get("probability", 0), - in_seg=function_params.get("in_seg", 0.0), - out_seg=function_params.get("out_seg", 0.0), - mix_in_out=function_params.get("mix_in_out", False), - retain_stats=function_params.get("retain_stats", False), - ) - for func in func_list - ) - - # Bias field artifact - bias_field_params = self.transform_params.get("BiasFieldTransform") - if bias_field_params is not None: - ta_transforms.append( - RandomBiasFieldGPU( - p=bias_field_params.get("probability", 0), - in_seg=bias_field_params.get("in_seg", 0.0), - out_seg=bias_field_params.get("out_seg", 0.0), - mix_in_out=bias_field_params.get("mix_in_out", False), - retain_stats=bias_field_params.get("retain_stats", False), - coefficients=bias_field_params.get("coefficients", 0.5), - ) - ) - - ## General enhancement (GE) - ge_transforms: list[ImageOnlyTransform] = [] - # Clamping transform - clamp_params = self.transform_params.get("ClampTransform") - if clamp_params is not None: - ge_transforms.append( - RandomClampGPU( - max_clamp_amount=clamp_params.get("max_clamp_amount", 0.0), - in_seg=clamp_params.get("in_seg", 0.0), - out_seg=clamp_params.get("out_seg", 0.0), - mix_in_out=clamp_params.get("mix_in_out", False), - retain_stats=clamp_params.get("retain_stats", False), - p=clamp_params.get("probability", 0), - ) - ) - - # Noise transforms - noise_params = self.transform_params.get("GaussianNoiseTransform") - if noise_params is not None: - ge_transforms.append( - RandomGaussianNoiseGPU( - mean=noise_params.get("mean", 0.0), - std=noise_params.get("std", 1.0), - in_seg=noise_params.get("in_seg", 0.0), - out_seg=noise_params.get("out_seg", 0.0), - mix_in_out=noise_params.get("mix_in_out", False), - p=noise_params.get("probability", 0), - ) - ) - - # Gaussian blur - gaussianblur_params = self.transform_params.get("GaussianBlurTransform") - if gaussianblur_params is not None: - ge_transforms.append( - RandomConvTransformGPU( - kernel_type=gaussianblur_params.get("kernel_type", "GaussianBlur"), - in_seg=gaussianblur_params.get("in_seg", 0.0), - out_seg=gaussianblur_params.get("out_seg", 0.0), - mix_in_out=gaussianblur_params.get("mix_in_out", False), - p=gaussianblur_params.get("probability", 0), - sigma=gaussianblur_params.get("sigma", 1.0), - ) - ) - - # Brightness transforms - brightness_params = self.transform_params.get("BrightnessTransform") - if brightness_params is not None: - ge_transforms.append( - RandomBrightnessGPU( - brightness_range=brightness_params.get("brightness_range", [0.5, 1.5]), - in_seg=brightness_params.get("in_seg", 0.0), - out_seg=brightness_params.get("out_seg", 0.0), - mix_in_out=brightness_params.get("mix_in_out", False), - p=brightness_params.get("probability", 0), - ) - ) - - # Gamma transforms - gamma_params = self.transform_params.get("GammaTransform") - if gamma_params is not None: - ge_transforms.append( - _RandomGammaWithInvertGPU( - gamma_range=gamma_params.get("gamma_range", [0.7, 1.5]), - p=gamma_params.get("probability", 0), - invert_image=False, - in_seg=gamma_params.get("in_seg", 0.0), - out_seg=gamma_params.get("out_seg", 0.0), - mix_in_out=gamma_params.get("mix_in_out", False), - retain_stats=gamma_params.get("retain_stats", False), - ) - ) - - inv_gamma_params = self.transform_params.get("InvGammaTransform") - if inv_gamma_params is not None: - ge_transforms.append( - _RandomGammaWithInvertGPU( - gamma_range=inv_gamma_params.get("gamma_range", [0.7, 1.5]), - p=inv_gamma_params.get("probability", 0), - in_seg=inv_gamma_params.get("in_seg", 0.0), - out_seg=inv_gamma_params.get("out_seg", 0.0), - mix_in_out=inv_gamma_params.get("mix_in_out", False), - invert_image=True, - retain_stats=inv_gamma_params.get("retain_stats", False), - ) - ) - - # nnUNetV2 Contrast transforms - contrast_params = self.transform_params.get("ContrastTransform") - if contrast_params is not None: - ge_transforms.append( - RandomContrastGPU( - contrast_range=contrast_params.get("contrast_range", [0.75, 1.25]), - p=contrast_params.get("probability", 0), - in_seg=contrast_params.get("in_seg", 0.0), - out_seg=contrast_params.get("out_seg", 0.0), - mix_in_out=contrast_params.get("mix_in_out", False), - retain_stats=contrast_params.get("retain_stats", False), - ) - ) - - # Shape transforms (Cropping and Simulating low resolution) - lowres_params = self.transform_params.get("SimulateLowResTransform") - if lowres_params is not None: - transforms.append( - RandomLowResTransformGPU( - p=lowres_params.get("probability", 0), - scale=lowres_params.get("scale", [0.3, 1.0]), - same_on_batch=lowres_params.get("same_on_batch", False), - ) - ) - - acq_params = self.transform_params.get("AcqTransform") - if acq_params is not None: - ge_transforms.append( - RandomAcqTransformGPU( - p=acq_params.get("probability", 0), - scale=acq_params.get("scale", [0.3, 1.0]), - same_on_batch=acq_params.get("same_on_batch", False), - ) - ) - - ## Random Z-score normalization - zscore_params = self.transform_params.get("ZscoreNormalizationTransform") - if zscore_params is not None: - ge_transforms.append(ZscoreNormalizationGPU(p=zscore_params.get("probability", 0))) - - choose_x_params = self.transform_params.get("RandomChooseXTransforms") - transforms.append( - RandomChooseXTransformsGPU( - transforms_list=ta_transforms, - num_transforms=len(ta_transforms), - p=choose_x_params.get("ta_probability", 1.0), - random_order=choose_x_params.get("ta_random_order", True), - ) - ) - transforms.append( - RandomChooseXTransformsGPU( - transforms_list=ge_transforms, - num_transforms=len(ge_transforms), - p=choose_x_params.get("ge_probability", 1.0), - random_order=choose_x_params.get("ge_random_order", True), - ) - ) - - return transforms +from smauglab.transforms.build import PipelineMode +from smauglab.transforms.gpu.base import ImageOnlyTransform +from smauglab.transforms.gpu.transforms import AugTransformsGPU -class AugTransformsGPURandomOrderTA(AugmentationSequentialCustom): - """ - Module to perform data augmentation on GPU. - """ - - def __init__(self, json_path: str): - # Load transform parameters from JSON - config_path = os.path.join(json_path) - with open(config_path) as f: - config = json.load(f) - - if "GPU" in config.keys(): - self.transform_params = config["GPU"] - else: - self.transform_params = config - - transforms = self._build_transforms() - super().__init__( - *transforms, data_keys=["input", "mask"], same_on_batch=True - ) # Same_on_batch to ensure mask are aligned with images correctly (custom) see AugmentationSequentialOpsCustom in base.py - - def _build_transforms(self) -> list[TransformType]: - # Annotated rather than inferred: an empty list takes its element type from - # the first append, which would pin it to whichever transform the config - # happens to enable first and reject every sibling appended after it. - transforms: list[TransformType] = [] - - # Flipping transforms - flip_params = self.transform_params.get("FlipTransform") - if flip_params is not None: - transforms.append( - RandomFlipTransformGPU( - flip_axis=flip_params.get("flip_axis", [0]), - p=flip_params.get("probability", 0), - same_on_batch=flip_params.get("same_on_batch", False), - keepdim=flip_params.get("keepdim", True), - ) - ) - - # Spatial transforms - affine_params = self.transform_params.get("AffineTransform") - if affine_params is not None: - transforms.append( - RandomAffineGPU( - degrees=affine_params.get("degrees", 10), - translate=affine_params.get("translate", [0.1, 0.1, 0.1]), - scale=affine_params.get("scale", [0.9, 1.1]), - shears=affine_params.get("shear", [-10, 10, -10, 10, -10, 10]), - resample=affine_params.get("resample", "bilinear"), - p=affine_params.get("probability", 0), - ) - ) - - ## Transfer augmentations (TA) - ta_transforms: list[ImageOnlyTransform] = [] - # Inverse transform (max - pixel_value) - inverse_params = self.transform_params.get("InverseTransform") - if inverse_params is not None: - ta_transforms.append( - RandomInverseGPU( - p=inverse_params.get("probability", 0), - in_seg=inverse_params.get("in_seg", 0.0), - out_seg=inverse_params.get("out_seg", 0.0), - mix_in_out=inverse_params.get("mix_in_out", False), - mix_prob=inverse_params.get("mix_prob", 0.0), - retain_stats=inverse_params.get("retain_stats", False), - ) - ) - - # Histogram manipulations - histo_params = self.transform_params.get("HistogramEqualizationTransform") - if histo_params is not None: - ta_transforms.append( - RandomHistogramEqualizationGPU( - p=histo_params.get("probability", 0), - in_seg=histo_params.get("in_seg", 0.0), - out_seg=histo_params.get("out_seg", 0.0), - mix_in_out=histo_params.get("mix_in_out", False), - mix_prob=histo_params.get("mix_prob", 0.0), - retain_stats=histo_params.get("retain_stats", False), - ) - ) - - # Redistribute segmentation values transform - redistribute_params = self.transform_params.get("RedistributeSegTransform") - if redistribute_params is not None: - ta_transforms.append( - RandomRedistributeSegGPU( - in_seg=redistribute_params.get("in_seg", 0.2), - retain_stats=redistribute_params.get("retain_stats", False), - p=redistribute_params.get("probability", 0), - ) - ) - - # Scharr filter - scharr_params = self.transform_params.get("ScharrTransform") - if scharr_params is not None: - ta_transforms.append( - RandomConvTransformGPU( - kernel_type=scharr_params.get("kernel_type", "Scharr"), - p=scharr_params.get("probability", 0), - in_seg=scharr_params.get("in_seg", 0.0), - out_seg=scharr_params.get("out_seg", 0.0), - mix_in_out=scharr_params.get("mix_in_out", False), - retain_stats=scharr_params.get("retain_stats", True), - absolute=scharr_params.get("absolute", True), - mix_prob=scharr_params.get("mix_prob", 0.0), - ) - ) - - # Unsharp masking - unsharp_params = self.transform_params.get("UnsharpMaskTransform") - if unsharp_params is not None: - ta_transforms.append( - RandomConvTransformGPU( - kernel_type=unsharp_params.get("kernel_type", "UnsharpMask"), - p=unsharp_params.get("probability", 0), - in_seg=unsharp_params.get("in_seg", 0.0), - out_seg=unsharp_params.get("out_seg", 0.0), - mix_in_out=unsharp_params.get("mix_in_out", False), - sigma=unsharp_params.get("sigma", 1.0), - unsharp_amount=unsharp_params.get("unsharp_amount", 1.5), - mix_prob=unsharp_params.get("mix_prob", 0.0), - ) - ) - - # RandomConv transform - randconv_params = self.transform_params.get("RandomConvTransform") - if randconv_params is not None: - ta_transforms.append( - RandomConvTransformGPU( - kernel_type=randconv_params.get("kernel_type", "RandConv"), - p=randconv_params.get("probability", 0), - in_seg=randconv_params.get("in_seg", 0.0), - out_seg=randconv_params.get("out_seg", 0.0), - mix_in_out=randconv_params.get("mix_in_out", False), - retain_stats=randconv_params.get("retain_stats", False), - kernel_sizes=randconv_params.get("kernel_sizes", [1, 3, 5, 7]), - mix_prob=randconv_params.get("mix_prob", 0.0), - ) - ) - - # Apply functions - func_list = [ - lambda x: torch.log(1 + x), - torch.sqrt, - torch.sin, - torch.exp, - lambda x: 1 / (1 + torch.exp(-x)), - ] - function_params = self.transform_params.get("FunctionTransform") - if function_params is not None: - ta_transforms.extend( - RandomFunctionGPU( - func=func, - p=function_params.get("probability", 0), - in_seg=function_params.get("in_seg", 0.0), - out_seg=function_params.get("out_seg", 0.0), - mix_in_out=function_params.get("mix_in_out", False), - retain_stats=function_params.get("retain_stats", False), - ) - for func in func_list - ) - - # Bias field artifact - bias_field_params = self.transform_params.get("BiasFieldTransform") - if bias_field_params is not None: - ta_transforms.append( - RandomBiasFieldGPU( - p=bias_field_params.get("probability", 0), - in_seg=bias_field_params.get("in_seg", 0.0), - out_seg=bias_field_params.get("out_seg", 0.0), - mix_in_out=bias_field_params.get("mix_in_out", False), - retain_stats=bias_field_params.get("retain_stats", False), - coefficients=bias_field_params.get("coefficients", 0.5), - ) - ) +class AugTransformsGPURandomOrder(AugTransformsGPU): + """Geometry in order, then the TA and GE groups each shuffled in their own bucket.""" - choose_x_params = self.transform_params.get("RandomChooseXTransforms") - transforms.append( - RandomChooseXTransformsGPU( - transforms_list=ta_transforms, - num_transforms=len(ta_transforms), - p=choose_x_params.get("ta_probability", 1.0), - random_order=False, - ) - ) + mode = PipelineMode.RANDOM_ORDER - ## General enhancement (GE) - # Clamping transform - clamp_params = self.transform_params.get("ClampTransform") - if clamp_params is not None: - transforms.append( - RandomClampGPU( - max_clamp_amount=clamp_params.get("max_clamp_amount", 0.0), - in_seg=clamp_params.get("in_seg", 0.0), - out_seg=clamp_params.get("out_seg", 0.0), - mix_in_out=clamp_params.get("mix_in_out", False), - retain_stats=clamp_params.get("retain_stats", False), - p=clamp_params.get("probability", 0), - ) - ) - # Noise transforms - noise_params = self.transform_params.get("GaussianNoiseTransform") - if noise_params is not None: - transforms.append( - RandomGaussianNoiseGPU( - mean=noise_params.get("mean", 0.0), - std=noise_params.get("std", 1.0), - in_seg=noise_params.get("in_seg", 0.0), - out_seg=noise_params.get("out_seg", 0.0), - mix_in_out=noise_params.get("mix_in_out", False), - p=noise_params.get("probability", 0), - ) - ) +class AugTransformsGPURandomOrderTA(AugTransformsGPU): + """Only the transfer augmentations are bucketed; everything else keeps its order.""" - # Gaussian blur - gaussianblur_params = self.transform_params.get("GaussianBlurTransform") - if gaussianblur_params is not None: - transforms.append( - RandomConvTransformGPU( - kernel_type=gaussianblur_params.get("kernel_type", "GaussianBlur"), - in_seg=gaussianblur_params.get("in_seg", 0.0), - out_seg=gaussianblur_params.get("out_seg", 0.0), - mix_in_out=gaussianblur_params.get("mix_in_out", False), - p=gaussianblur_params.get("probability", 0), - sigma=gaussianblur_params.get("sigma", 1.0), - ) - ) - - # Brightness transforms - brightness_params = self.transform_params.get("BrightnessTransform") - if brightness_params is not None: - transforms.append( - RandomBrightnessGPU( - brightness_range=brightness_params.get("brightness_range", [0.5, 1.5]), - in_seg=brightness_params.get("in_seg", 0.0), - out_seg=brightness_params.get("out_seg", 0.0), - mix_in_out=brightness_params.get("mix_in_out", False), - p=brightness_params.get("probability", 0), - ) - ) - - # Gamma transforms - gamma_params = self.transform_params.get("GammaTransform") - if gamma_params is not None: - transforms.append( - _RandomGammaWithInvertGPU( - gamma_range=gamma_params.get("gamma_range", [0.7, 1.5]), - p=gamma_params.get("probability", 0), - invert_image=False, - in_seg=gamma_params.get("in_seg", 0.0), - out_seg=gamma_params.get("out_seg", 0.0), - mix_in_out=gamma_params.get("mix_in_out", False), - retain_stats=gamma_params.get("retain_stats", False), - ) - ) - - inv_gamma_params = self.transform_params.get("InvGammaTransform") - if inv_gamma_params is not None: - transforms.append( - _RandomGammaWithInvertGPU( - gamma_range=inv_gamma_params.get("gamma_range", [0.7, 1.5]), - p=inv_gamma_params.get("probability", 0), - in_seg=inv_gamma_params.get("in_seg", 0.0), - out_seg=inv_gamma_params.get("out_seg", 0.0), - mix_in_out=inv_gamma_params.get("mix_in_out", False), - invert_image=True, - retain_stats=inv_gamma_params.get("retain_stats", False), - ) - ) - - # nnUNetV2 Contrast transforms - contrast_params = self.transform_params.get("ContrastTransform") - if contrast_params is not None: - transforms.append( - RandomContrastGPU( - contrast_range=contrast_params.get("contrast_range", [0.75, 1.25]), - p=contrast_params.get("probability", 0), - in_seg=contrast_params.get("in_seg", 0.0), - out_seg=contrast_params.get("out_seg", 0.0), - mix_in_out=contrast_params.get("mix_in_out", False), - retain_stats=contrast_params.get("retain_stats", False), - ) - ) - - # Shape transforms (Cropping and Simulating low resolution) - lowres_params = self.transform_params.get("SimulateLowResTransform") - if lowres_params is not None: - transforms.append( - RandomLowResTransformGPU( - p=lowres_params.get("probability", 0), - scale=lowres_params.get("scale", [0.3, 1.0]), - same_on_batch=lowres_params.get("same_on_batch", False), - ) - ) - - acq_params = self.transform_params.get("AcqTransform") - if acq_params is not None: - transforms.append( - RandomAcqTransformGPU( - p=acq_params.get("probability", 0), - scale=acq_params.get("scale", [0.3, 1.0]), - same_on_batch=acq_params.get("same_on_batch", False), - ) - ) - - ## Random Z-score normalization - zscore_params = self.transform_params.get("ZscoreNormalizationTransform") - if zscore_params is not None: - transforms.append(ZscoreNormalizationGPU(p=zscore_params.get("probability", 0))) - - return transforms + mode = PipelineMode.RANDOM_ORDER_TA class RandomChooseXTransformsGPU(ImageOnlyTransform): @@ -685,11 +50,11 @@ def __init__( num_transforms: int = 1, same_on_batch: bool = False, p: float = 1.0, + p_batch: float = 1.0, keepdim: bool = True, random_order: bool = True, - **kwargs, ) -> None: - super().__init__(p=p, same_on_batch=same_on_batch, keepdim=keepdim) + super().__init__(p=p, p_batch=p_batch, same_on_batch=same_on_batch, keepdim=keepdim) if not isinstance(num_transforms, int) or num_transforms < 0: raise ValueError(f"num_transforms must be a non-negative int. Got {num_transforms!r}.") self.transforms_list = nn.ModuleList(transforms_list) @@ -750,26 +115,3 @@ def apply_transform(self, input: Tensor, params: dict[str, Tensor], flags: dict[ xi = self._apply_mix(xi, seg_i) out[i : i + 1] = xi return out - - -def normalize(arr: np.ndarray) -> np.ndarray: - """ - Normalize a tensor to the range [0, 1]. - """ - min_val = np.min(arr) - max_val = np.max(arr) - normalized_arr = (arr - min_val) / (max_val - min_val + 1e-8) - return normalized_arr - - -def pad_numpy_array(arr, shape): - """ - Pad a numpy array to the desired shape with zeros. - """ - # Calculate padding needed for each dimension - pad_width = [ - (max(0, shape[i] - arr.shape[i]) // 2, max(0, shape[i] - arr.shape[i]) - max(0, shape[i] - arr.shape[i]) // 2) - for i in range(len(shape)) - ] - padded_arr = np.pad(arr, pad_width, mode="constant", constant_values=0) - return padded_arr diff --git a/unit_tests/fixtures/legacy_configs/configs/synthseg_params.json b/unit_tests/fixtures/legacy_configs/configs/synthseg_params.json new file mode 100644 index 0000000..5bdb158 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/synthseg_params.json @@ -0,0 +1,50 @@ +{ + "SynthSeg": { + "probability": 1.0, + "n_channels": 1, + "generation_labels": null, + "output_labels": null, + "n_neutral_labels": null, + "generation_classes": null, + + "prior_distributions": "uniform", + "prior_means": null, + "prior_stds": null, + + "flipping": true, + "flip_axis": 2, + "scaling_bounds": 0.2, + "rotation_bounds": 15.0, + "shearing_bounds": 0.012, + "translation_bounds": false, + + "nonlin_std": 4.0, + "nonlin_scale": 0.04, + "svf_integration_steps": 7, + + "bias_field_std": 0.7, + "bias_scale": 0.025, + + "gamma_std": 0.5, + "clip": 300.0, + "normalise": true, + + "randomise_res": true, + "max_res_iso": 4.0, + "max_res_aniso": 8.0, + "data_res": null, + "thickness": null, + "blur_range": 1.03, + "atlas_res": 1.0, + + "output_shape": null, + + "em_label_completion": false, + "em_n_foreground_clusters": 2, + "em_background_clusters_range": [3, 10], + "em_background_label": 0, + "em_n_iters": 20, + "em_max_fit_voxels": 100000, + "em_same_on_batch": false + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params.json b/unit_tests/fixtures/legacy_configs/configs/transform_params.json new file mode 100644 index 0000000..1c3b07b --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params.json @@ -0,0 +1,98 @@ +{ + "retain_stats": true, + "mirror_axes": [0,1,2], + "ArtifactTransform": { + "motion": false, + "ghosting": false, + "spike": false, + "bias_field": false, + "blur": false, + "noise": false, + "swap": false, + "random_pick": false, + "probability": 0.7 + }, + "SpatialCustomTransform": { + "flip": false, + "affine": false, + "elastic": false, + "anisotropy": false, + "random_pick": false, + "probability": 0.6 + }, + "ConvTransform": { + "kernel_type": "Laplace", + "absolute": false, + "retain_stats": false, + "probability": 0.15 + }, + "RedistributeTransform": { + "classes": null, + "in_seg": 0.2, + "retain_stats": false, + "probability": 0.5 + }, + "ShapeTransform": { + "shape_min": 1, + "ignore_axes": [1,2], + "probability": 0.4 + }, + "HistogramEqualTransform": { + "probability": 0.1 + }, + "FunctionTransform": { + "probability": 0.05 + }, + "GaussianNoiseTransform": { + "noise_variance": [0, 0.1], + "p_per_channel": 1, + "synchronize_channels": true, + "probability": 0.1 + }, + "GaussianBlurTransform": { + "blur_sigma": [0.5, 1.0], + "synchronize_channels": false, + "synchronize_axes": false, + "p_per_channel": 0.5, + "benchmark": true, + "probability": 0.2 + }, + "MultiplicativeBrightnessTransform": { + "multiplier_range": [0.75, 1.25], + "synchronize_channels": false, + "p_per_channel": 1, + "probability": 0.15 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "preserve_range": true, + "synchronize_channels": false, + "p_per_channel": 1, + "probability": 0.15 + }, + "SimulateLowResolutionTransform": { + "scale": [0.3, 1], + "synchronize_channels": true, + "synchronize_axes": false, + "ignore_axes": [], + "allowed_channels": null, + "p_per_channel": 0.5, + "probability": 0.2 + }, + "GammaTransform_invert": { + "gamma": [0.7, 1.5], + "p_invert_image": 1, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "probability": 0.1 + }, + "GammaTransform": { + "gamma": [0.7, 1.5], + "p_invert_image": 0, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "probability": 0.3 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu.json new file mode 100644 index 0000000..397eb91 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu.json @@ -0,0 +1,209 @@ +{ + "RandomPALETTETransform": { + "probability": 0.25, + "c_choices": [ + 2, + 3, + 4, + 5, + 6 + ], + "s_choices": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "blur_sigmas": [ + 0.0, + 0.0, + 0.0, + 0.3, + 0.5, + 0.8 + ], + "dark_threshold": 0.01, + "n_kmeans_subsample": 10000, + "skip_parcellation_prob": 0.1, + "skip_sub_parc_prob": 0.4, + "alpha_magnitude_range": [ + 0.5, + 2.0 + ], + "label_remap_prob": 0.5, + "min_label_voxels": 4, + "label_classes": null + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.1, 1.0], + "same_on_batch": false, + "probability": 0.2 + }, + "CropTransform": { + "crop": [0.5, 1.0], + "pos": [0.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noGE.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noGE.json new file mode 100644 index 0000000..32fd2e3 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noGE.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.00 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.0 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.5, + "p_scaling": 0.5, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-heavyFunction.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-heavyFunction.json new file mode 100644 index 0000000..204c74b --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-heavyFunction.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.0 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.05 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.25 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.05 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.5, + "p_scaling": 0.5, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-nobias.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-nobias.json new file mode 100644 index 0000000..b085063 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA-nobias.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.0 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.05 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.01 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.05 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.5, + "p_scaling": 0.5, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA.json new file mode 100644 index 0000000..1743064 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0-noTA.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.0 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.05 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.01 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.05 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.5, + "p_scaling": 0.5, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0.json new file mode 100644 index 0000000..9eacc73 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_basedon3d250af0.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.05 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.01 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.05 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.5, + "p_scaling": 0.5, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA05.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA05.json new file mode 100644 index 0000000..585a942 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA05.json @@ -0,0 +1,171 @@ +{ + "RandomChooseXTransforms": { + "ge_probability": 1.0, + "ta_probability": 0.5, + "ta_random_order": false, + "ge_random_order": false + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA08.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA08.json new file mode 100644 index 0000000..80c55ee --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List-TA08.json @@ -0,0 +1,169 @@ +{ + "RandomChooseXTransforms": { + "ge_probability": 1.0, + "ta_probability": 0.8 + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List.json new file mode 100644 index 0000000..3ad2f9b --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-List.json @@ -0,0 +1,169 @@ +{ + "RandomChooseXTransforms": { + "ge_probability": 1.0, + "ta_probability": 1.0 + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-Scharr.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-Scharr.json new file mode 100755 index 0000000..89fde45 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-Scharr.json @@ -0,0 +1,108 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.5 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-focus.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-focus.json new file mode 100644 index 0000000..8d5310a --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-focus.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.35 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.5 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noGE.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noGE.json new file mode 100644 index 0000000..705acbf --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noGE.json @@ -0,0 +1,96 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror-RandConv.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror-RandConv.json new file mode 100644 index 0000000..4034358 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror-RandConv.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.00 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.0 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.0, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror.json new file mode 100644 index 0000000..60f81aa --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noMirror.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.0 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noTA.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noTA.json new file mode 100644 index 0000000..1e0407b --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23-noTA.json @@ -0,0 +1,98 @@ +{ + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23.json new file mode 100644 index 0000000..c037ff6 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_CropTransform.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_CropTransform.json new file mode 100644 index 0000000..a58c7b5 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_CropTransform.json @@ -0,0 +1,171 @@ +{ + "CropTransform": { + "crop": [0.5, 1.0], + "pos": [0.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ICGT_plus.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ICGT_plus.json new file mode 100644 index 0000000..7625626 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ICGT_plus.json @@ -0,0 +1,170 @@ +{ + "ImageContrastGPUTransform": { + "num_bins": 32, + "label_classes": [0,1,2,3], + "probability": 0.5 + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ImageContrastGPUTransform.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ImageContrastGPUTransform.json new file mode 100644 index 0000000..9eb176e --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_ImageContrastGPUTransform.json @@ -0,0 +1,170 @@ +{ + "ImageContrastGPUTransform": { + "num_bins": 32, + "label_classes": [0,1,2,3], + "probability": 0.5 + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.0 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_RandomDomainTransferGPU.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_RandomDomainTransferGPU.json new file mode 100644 index 0000000..b215275 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_RandomDomainTransferGPU.json @@ -0,0 +1,180 @@ +{ + "RandomDomainTransferGPU": { + "source_label": "spinegan_ct", + "sigma": 2.0, + "probability": 0.5, + "include_self": true, + "any_source": true, + "blend_targets": 1, + "blend_concentration": 0.5, + "p_class_mix": 0.0, + "bias_field_std": 0.0, + "bias_scale": 0.03, + "p_spatial_mix": 0.0, + "spatial_mix_scale": 0.03, + "spatial_mix_gain": 3.0 + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.0 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_Synthseg.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_Synthseg.json new file mode 100644 index 0000000..3a20945 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_Synthseg.json @@ -0,0 +1,213 @@ +{ + "SynthSeg": { + "probability": 1.0, + "n_channels": 1, + "generation_labels": null, + "output_labels": null, + "n_neutral_labels": null, + "generation_classes": null, + + "prior_distributions": "uniform", + "prior_means": null, + "prior_stds": null, + + "flipping": true, + "flip_axis": 2, + "scaling_bounds": 0.2, + "rotation_bounds": 15.0, + "shearing_bounds": 0.012, + "translation_bounds": false, + + "nonlin_std": 4.0, + "nonlin_scale": 0.04, + "svf_integration_steps": 7, + + "bias_field_std": 0.7, + "bias_scale": 0.025, + + "gamma_std": 0.5, + "clip": 300.0, + "normalise": true, + + "randomise_res": true, + "max_res_iso": 4.0, + "max_res_aniso": 8.0, + "data_res": null, + "thickness": null, + "blur_range": 1.03, + "atlas_res": 1.0, + + "output_shape": null, + + "em_label_completion": false, + "em_n_foreground_clusters": 2, + "em_background_clusters_range": [3, 10], + "em_background_label": 0, + "em_n_iters": 20, + "em_max_fit_voxels": 100000, + "em_same_on_batch": false + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.0 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.0 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.0 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.0 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.0 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_SynthsegPlus.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_SynthsegPlus.json new file mode 100644 index 0000000..43b7e34 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_default01-23_SynthsegPlus.json @@ -0,0 +1,213 @@ +{ + "SynthSeg": { + "probability": 0.25, + "n_channels": 1, + "generation_labels": null, + "output_labels": null, + "n_neutral_labels": null, + "generation_classes": null, + + "prior_distributions": "uniform", + "prior_means": null, + "prior_stds": null, + + "flipping": true, + "flip_axis": 2, + "scaling_bounds": 0.2, + "rotation_bounds": 15.0, + "shearing_bounds": 0.012, + "translation_bounds": false, + + "nonlin_std": 4.0, + "nonlin_scale": 0.04, + "svf_integration_steps": 7, + + "bias_field_std": 0.7, + "bias_scale": 0.025, + + "gamma_std": 0.5, + "clip": 300.0, + "normalise": true, + + "randomise_res": true, + "max_res_iso": 4.0, + "max_res_aniso": 8.0, + "data_res": null, + "thickness": null, + "blur_range": 1.03, + "atlas_res": 1.0, + + "output_shape": null, + + "em_label_completion": true, + "em_n_foreground_clusters": 2, + "em_background_clusters_range": [3, 10], + "em_background_label": 0, + "em_n_iters": 20, + "em_max_fit_voxels": 100000, + "em_same_on_batch": false + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_inoutseg.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_inoutseg.json new file mode 100644 index 0000000..260c4b6 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_inoutseg.json @@ -0,0 +1,155 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.15 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.50, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.15 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.10 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.10 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.1 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.15 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.05 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.5 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.50 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.30 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.5 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.025 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.1 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.80, + "probability": 0.10 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.05 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.5 + }, + "ZscoreNormalizationTransform": { + "probability": 0.0 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_palette-em.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_palette-em.json new file mode 100644 index 0000000..c402486 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_gpu_palette-em.json @@ -0,0 +1,232 @@ +{ + "PaletteSynthesisTransform": { + "probability": 0.25, + "dark_threshold": 0.01, + "alpha_magnitude_range": [ + 0.5, + 2.0 + ], + "blur_sigmas_pre": [ + 0.0, + 0.0, + 0.0, + 0.3, + 0.5, + 0.8 + ], + "blur_sigmas_post": [ + 0.0, + 0.0, + 0.0, + 0.3, + 0.5, + 0.8 + ], + "initial_partitioner": { + "type": "em_gmm", + "n_foreground_clusters": 3, + "background_clusters_range": [ + 3, + 8 + ], + "background_label": 0, + "n_iters": 20, + "max_fit_voxels": 100000 + }, + "refinement_partitioners": [ + { + "type": "voronoi", + "s_choices": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ], + "skip_prob": 0.4 + } + ], + "overlay": { + "enabled": true, + "label_remap_prob": 0.5, + "min_label_voxels": 4, + "label_classes": null, + "blend_strength": 1.0, + "alpha_magnitude_range": [ + 0.5, + 2.0 + ] + } + }, + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3, 5, 7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.1, 1.0], + "same_on_batch": false, + "probability": 0.2 + }, + "CropTransform": { + "crop": [0.5, 1.0], + "pos": [0.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid.json new file mode 100644 index 0000000..d27cce8 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid.json @@ -0,0 +1,262 @@ +{ + "CPU": { + "Comment1": "AugLab custom CPU augmentations", + "ConvTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": false, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": false, + "probability": 0.05 + }, + "HistogramEqualTransform": { + "retain_stats": false, + "probability": 0.1 + }, + "RedistributeTransform": { + "in_seg": 0.2, + "retain_stats": false, + "probability": 0.5 + }, + "ShapeTransform": { + "shape_min": 1, + "ignore_axes": [1,2], + "probability": 0.4 + }, + "ArtifactTransform":{ + "motion": true, + "ghosting": true, + "spike": true, + "bias_field": true, + "blur": true, + "noise": true, + "swap": false, + "random_pick": true, + "probability": 0 + }, + "SpatialCustomTransform": { + "flip": true, + "affine": true, + "elastic": true, + "anisotropy": true, + "random_pick": true, + "probability": 0 + }, + + "Comment2": "nnUNet default CPU augmentations", + "SpatialTransform": { + "patch_center_dist_from_border": 0, + "random_crop": false, + "p_elastic_deform": 0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "GaussianNoiseTransform": { + "noise_variance": [0, 0.1], + "p_per_channel": 1, + "synchronize_channels": true, + "probability": 0.1 + }, + "GaussianBlurTransform": { + "blur_sigma": [0.5, 1.0], + "synchronize_channels": false, + "synchronize_axes": false, + "p_per_channel": 0.5, + "benchmark": true, + "probability": 0.2 + }, + "MultiplicativeBrightnessTransform": { + "multiplier_range": [0.75, 1.25], + "synchronize_channels": false, + "p_per_channel": 1, + "probability": 0.15 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "preserve_range": true, + "synchronize_channels": false, + "p_per_channel": 1, + "probability": 0.15 + }, + "SimulateLowResolutionTransform": { + "scale": [0.3, 1], + "synchronize_channels": true, + "synchronize_axes": false, + "ignore_axes": [], + "p_per_channel": 0.5, + "probability": 0.2 + }, + "GammaTransform_invert": { + "gamma": [0.7, 1.5], + "p_invert_image": 1, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "probability": 0.1 + }, + "GammaTransform": { + "gamma": [0.7, 1.5], + "p_invert_image": 0, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "probability": 0.3 + } + }, + "GPU": { + "Comment1": "AugLab custom GPU augmentations", + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.15 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": false, + "probability": 0.10 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [1,3,5,7], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "mix_prob": 0.20, + "probability": 0.10 + }, + "RedistributeSegTransform": { + "in_seg": 0.2, + "retain_stats": false, + "probability": 0.3 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 0.1, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.40 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": false, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": false, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.05 + }, + "InverseTransform": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.30 + }, + "HistogramEqualizationTransform": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.20 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.2, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.40 + }, + "BiasFieldTransform": { + "retain_stats": false, + "coefficients": 0.5, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": false, + "probability": 0.20 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0 + }, + "AffineTransform": { + "degrees": 10, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-10, 10, -10, 10, -10, 10], + "resample": "bilinear", + "probability": 0 + }, + "ZscoreNormalizationTransform": { + "probability": 0.3 + } + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid_TAGE.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid_TAGE.json new file mode 100644 index 0000000..9382fc6 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_hybrid_TAGE.json @@ -0,0 +1,264 @@ +{ + "CPU": { + "Comment1": "CPU transfer augmentations (TA)", + "ConvTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": false, + "probability": 0.15 + }, + "HistogramEqualTransform": { + "retain_stats": false, + "probability": 0.1 + }, + "RedistributeTransform": { + "in_seg": 0.2, + "retain_stats": false, + "probability": 0.5 + }, + + "Comment2": "CPU general enhancement (GE)", + "FunctionTransform": { + "retain_stats": false, + "probability": 0.05 + }, + "ShapeTransform": { + "shape_min": 1, + "ignore_axes": [1,2], + "probability": 0.4 + }, + "ArtifactTransform":{ + "motion": true, + "ghosting": true, + "spike": true, + "bias_field": true, + "blur": true, + "noise": true, + "swap": false, + "random_pick": true, + "probability": 0 + }, + "SpatialCustomTransform": { + "flip": true, + "affine": true, + "elastic": true, + "anisotropy": true, + "random_pick": true, + "probability": 0 + }, + "SpatialTransform": { + "patch_center_dist_from_border": 0, + "random_crop": false, + "p_elastic_deform": 0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "GaussianNoiseTransform": { + "noise_variance": [0, 0.1], + "p_per_channel": 1, + "synchronize_channels": true, + "probability": 0.1 + }, + "GaussianBlurTransform": { + "blur_sigma": [0.5, 1.0], + "synchronize_channels": false, + "synchronize_axes": false, + "p_per_channel": 0.5, + "benchmark": true, + "probability": 0.2 + }, + "MultiplicativeBrightnessTransform": { + "multiplier_range": [0.75, 1.25], + "synchronize_channels": false, + "p_per_channel": 1, + "probability": 0.15 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "preserve_range": true, + "synchronize_channels": false, + "p_per_channel": 1, + "probability": 0.15 + }, + "SimulateLowResolutionTransform": { + "scale": [0.3, 1], + "synchronize_channels": true, + "synchronize_axes": false, + "ignore_axes": [], + "p_per_channel": 0.5, + "probability": 0.2 + }, + "GammaTransform_invert": { + "gamma": [0.7, 1.5], + "p_invert_image": 1, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "probability": 0.1 + }, + "GammaTransform": { + "gamma": [0.7, 1.5], + "p_invert_image": 0, + "synchronize_channels": false, + "p_per_channel": 1, + "p_retain_stats": 1, + "probability": 0.3 + } + }, + "GPU": { + "Comment1": "GPU transfer augmentations (TA)", + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.15 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [1,3,5,7], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "mix_prob": 0.20, + "probability": 0.10 + }, + "RedistributeSegTransform": { + "in_seg": 0.2, + "retain_stats": false, + "probability": 0.3 + }, + "InverseTransform": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.30 + }, + "HistogramEqualizationTransform": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.20 + }, + + "Comment2": "GPU general enhancement (GE)", + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": false, + "probability": 0.10 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 0.1, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.40 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": false, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": false, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": false, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": true, + "probability": 0.05 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [0.8, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.2, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.40 + }, + "BiasFieldTransform": { + "retain_stats": false, + "coefficients": 0.5, + "in_seg": 0.5, + "out_seg": 0.5, + "mix_in_out": false, + "probability": 0.20 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0 + }, + "AffineTransform": { + "degrees": 10, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-10, 10, -10, 10, -10, 10], + "resample": "bilinear", + "probability": 0 + }, + "ZscoreNormalizationTransform": { + "probability": 0 + } + } +} diff --git a/unit_tests/fixtures/legacy_configs/configs/transform_params_one-sequence-to-segment-them-all.json b/unit_tests/fixtures/legacy_configs/configs/transform_params_one-sequence-to-segment-them-all.json new file mode 100755 index 0000000..c037ff6 --- /dev/null +++ b/unit_tests/fixtures/legacy_configs/configs/transform_params_one-sequence-to-segment-them-all.json @@ -0,0 +1,165 @@ +{ + "ScharrTransform": { + "kernel_type": "Scharr", + "absolute": true, + "retain_stats": true, + "mix_prob": 0.50, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.25 + }, + "GaussianBlurTransform": { + "kernel_type": "GaussianBlur", + "sigma": 1.0, + "retain_stats": false, + "mix_prob": 0.00, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.20 + }, + "UnsharpMaskTransform": { + "kernel_type": "UnsharpMask", + "sigma": 1.0, + "unsharp_amount": 1.5, + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.25 + }, + "RandomConvTransform": { + "kernel_type": "RandConv", + "kernel_sizes": [3,5,7], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.50, + "probability": 0.20 + }, + "RedistributeSegTransform": { + "in_seg": 0.25, + "retain_stats": true, + "probability": 0.4 + }, + "GaussianNoiseTransform": { + "mean": 0.0, + "std": 1.0, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.1 + }, + "ClampTransform": { + "max_clamp_amount": 0.2, + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.00 + }, + "BrightnessTransform": { + "brightness_range": [0.75, 1.25], + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "GammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.30 + }, + "InvGammaTransform": { + "gamma_range": [0.7, 1.5], + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.10 + }, + "ContrastTransform": { + "contrast_range": [0.75, 1.25], + "retain_stats": false, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FunctionTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": false, + "probability": 0.1 + }, + "InverseTransform": { + "retain_stats": true, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "mix_prob": 0.00, + "probability": 0.25 + }, + "HistogramEqualizationTransform": { + "retain_stats": true, + "in_seg": 0, + "out_seg": 0, + "mix_in_out": true, + "mix_prob": 0.60, + "probability": 0.25 + }, + "SimulateLowResTransform": { + "scale": [0.5, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.25 + }, + "AcqTransform": { + "scale": [0.6, 1.0], + "crop": [1.0, 1.0], + "same_on_batch": false, + "probability": 0.00 + }, + "BiasFieldTransform": { + "retain_stats": true, + "coefficients": 0.2, + "in_seg": 0.0, + "out_seg": 0.0, + "mix_in_out": true, + "probability": 0.15 + }, + "FlipTransform": { + "flip_axis": [0], + "same_on_batch": false, + "keepdim": true, + "probability": 0.5 + }, + "AffineTransform": { + "degrees": 5, + "translate": [0.1, 0.1, 0.1], + "scale": [0.7, 1.4], + "shear": [-5, 5, -5, 5, -5, 5], + "resample": "bilinear", + "probability": 0.0 + }, + "nnUNetSpatialTransform": { + "patch_center_dist_from_border": 80, + "random_crop": false, + "p_elastic_deform": 0.0, + "p_rotation": 0.2, + "p_scaling": 0.2, + "scaling": [0.7, 1.4], + "p_synchronize_scaling_across_axes": 1, + "bg_style_seg_sampling": false + }, + "ZscoreNormalizationTransform": { + "probability": 0.00 + } +} diff --git a/unit_tests/fixtures/legacy_effective_kwargs.json b/unit_tests/fixtures/legacy_effective_kwargs.json new file mode 100644 index 0000000..7e5a1bb --- /dev/null +++ b/unit_tests/fixtures/legacy_effective_kwargs.json @@ -0,0 +1,9889 @@ +{ + "transform_params_gpu.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomPaletteGPU", + { + "alpha_magnitude_range": "[0.5, 2.0]", + "blur_sigmas": "[0.0, 0.0, 0.0, 0.3, 0.5, 0.8]", + "c_choices": "[2, 3, 4, 5, 6]", + "dark_threshold": "0.01", + "keepdim": "False", + "label_classes": "None", + "label_remap_prob": "0.5", + "min_label_voxels": "4", + "n_kmeans_subsample": "10000", + "p": "0.25", + "p_batch": "1.0", + "s_choices": "[2, 3, 4, 5, 6, 7, 8, 9, 10]", + "same_on_batch": "False", + "skip_parcellation_prob": "0.1", + "skip_sub_parc_prob": "0.4" + } + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.2", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.1, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomCropTransformGPU", + { + "crop": "[0.5, 1.0]", + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "pos": "[0.0, 1.0]", + "same_on_batch": "False" + } + ], + [ + "CropGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_basedon3d250af0-noGE.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_basedon3d250af0-noTA-heavyFunction.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.05", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.05", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_basedon3d250af0-noTA-nobias.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.05", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.05", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_basedon3d250af0-noTA.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.05", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.05", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_basedon3d250af0.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.05", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.01", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.05", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-List-TA05.json|random_order": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "(1, 3)", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "(0.1, 0.3)" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-List-TA05.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-List-TA08.json|random_order": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "(1, 3)", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "(0.1, 0.3)" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-List-TA08.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-List.json|random_order": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "(1, 3)", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "(0.1, 0.3)" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-List.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-Scharr.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-focus.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.35", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-noGE.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-noMirror-RandConv.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-noMirror.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23-noTA.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23_CropTransform.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomCropTransformGPU", + { + "crop": "[0.5, 1.0]", + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "pos": "[0.0, 1.0]", + "same_on_batch": "False" + } + ], + [ + "CropGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23_ICGT_plus.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23_ImageContrastGPUTransform.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23_Synthseg.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomSynthSegGPU", + { + "apply_to_channel": "None", + "keepdim": "True", + "p": "1.0", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_default01-23_SynthsegPlus.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomSynthSegGPU", + { + "apply_to_channel": "None", + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_inoutseg.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.5", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.8", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.5", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.5", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.5", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.5", + "p": "0.05", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.5", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.5", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.5", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.5", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.5", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.5", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.5", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.5", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.5", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.5", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.5", + "p": "0.5", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.025", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.025", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.025", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.025", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.025", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.05", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.5", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.5", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_gpu_palette-em.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.2", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.1, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomCropTransformGPU", + { + "crop": "[0.5, 1.0]", + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "pos": "[0.0, 1.0]", + "same_on_batch": "False" + } + ], + [ + "CropGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ], + "transform_params_one-sequence-to-segment-them-all.json|sequential": [ + [ + "RandomFlipTransformGPU", + { + "flip_axis": "[0]", + "keepdim": "True", + "p": "0.5", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "FlipGenerator3D", + {} + ], + [ + "RandomAffineGPU", + { + "align_corners": "True", + "degrees": "5", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "resample": "'bilinear'", + "same_on_batch": "False", + "scale": "[0.7, 1.4]", + "shears": "[-5, 5, -5, 5, -5, 5]", + "translate": "[0.1, 0.1, 0.1]" + } + ], + [ + "AffineGenerator3D", + {} + ], + [ + "RandomInverseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomHistogramEqualizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "True", + "mix_prob": "0.6", + "out_seg": "0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomRedistributeSegGPU", + { + "apply_to_channel": "(0,)", + "dilation_iterations_range": "[1, 3]", + "in_seg": "0.25", + "keepdim": "True", + "p": "0.4", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "std_noise_range": "[0.1, 0.3]" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "True", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'Scharr'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'UnsharpMask'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.25", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.5" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "[3, 5, 7]", + "kernel_type": "'RandConv'", + "mix_in_out": "True", + "mix_prob": "0.5", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomClampGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "max_clamp_amount": "0.2", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomGaussianNoiseGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "mean": "0.0", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "same_on_batch": "False", + "std": "1.0" + } + ], + [ + "_RandomConvBaseGPU", + { + "absolute": "False", + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "kernel_sizes": "(1, 3, 5, 7)", + "kernel_type": "'GaussianBlur'", + "mix_in_out": "True", + "mix_prob": "0.0", + "out_seg": "0.0", + "p": "0.2", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False", + "sigma": "1.0", + "unsharp_amount": "1.0" + } + ], + [ + "RandomBrightnessGPU", + { + "apply_to_channel": "(0,)", + "brightness_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "False", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.3", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomGammaBaseGPU", + { + "apply_to_channel": "(0,)", + "gamma_range": "[0.7, 1.5]", + "in_seg": "0.0", + "invert_image": "True", + "keepdim": "False", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomContrastGPU", + { + "apply_to_channel": "(0,)", + "contrast_range": "[0.75, 1.25]", + "in_seg": "0.0", + "keepdim": "True", + "mix_in_out": "True", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "False", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.223144,0.405465,0.559616", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.500000,0.707107,0.866025", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.247404,0.479426,0.681639", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:1.284025,1.648721,2.117000", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "_RandomFunctionBaseGPU", + { + "apply_to_channel": "(0,)", + "func": "fn:0.562177,0.622459,0.679179", + "in_seg": "0", + "keepdim": "True", + "mix_in_out": "False", + "out_seg": "0", + "p": "0.1", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "RandomLowResTransformGPU", + { + "keepdim": "True", + "p": "0.25", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.5, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomAcqTransformGPU", + { + "apply_to_channel": "(0,)", + "keepdim": "True", + "p": "0.0", + "p_batch": "1.0", + "same_on_batch": "False", + "scale": "[0.6, 1.0]" + } + ], + [ + "ScaleGenerator3D", + {} + ], + [ + "RandomBiasFieldGPU", + { + "apply_to_channel": "(0,)", + "coefficients": "0.2", + "in_seg": "0.0", + "invert": "False", + "keepdim": "True", + "mix_in_out": "True", + "order": "3", + "out_seg": "0.0", + "p": "0.15", + "p_batch": "1.0", + "retain_stats": "True", + "same_on_batch": "False" + } + ], + [ + "ZscoreNormalizationGPU", + { + "apply_to_channel": "(0,)", + "in_seg": "0.0", + "keepdim": "True", + "out_seg": "0.0", + "p": "0.0", + "p_batch": "1.0" + } + ] + ] +} diff --git a/unit_tests/test_builder.py b/unit_tests/test_builder.py new file mode 100644 index 0000000..0ab3f14 --- /dev/null +++ b/unit_tests/test_builder.py @@ -0,0 +1,229 @@ +"""The registry-driven builder, against what the `if` ladders used to produce. + +`fixtures/legacy_effective_kwargs.json` records, per config and pipeline mode, the +class and effective constructor kwargs of every transform the hand-written ladders +built. It was captured from the commit before they were deleted, by instrumenting each +transform's `__init__`. This file is the evidence that replacing ~900 lines of dispatch +changed nothing about what gets built. + +Three differences are normalised away, because they are the change itself rather than a +difference in behaviour: + +* the ladders built one class parameterised by `kernel_type` / `func` / `invert_image`; + the builder builds the leaf class that replaced it; +* that shared class therefore bound kernel-specific parameters its leaves do not + declare -- a Scharr transform carried `sigma`, which only the blur reads; +* `p_batch` is new and defaults to kornia's own 1.0 either way. +""" + +from __future__ import annotations + +import contextlib +import functools +import importlib +import json +import re +from pathlib import Path +from typing import ClassVar + +import torch + +from smauglab.config import OrderSource, PipelineMode, SmaugConfig +from smauglab.registry import Backend, InvalidConfigError +from smauglab.transforms.build import build_gpu_pipeline, build_transforms +from unit_tests.helpers import SmaugLabTestCase + +FIXTURE = Path(__file__).parent / "fixtures" / "legacy_effective_kwargs.json" + +#: kernel_type value -> the leaf class that replaced it. +KERNEL_LEAF = { + "'Laplace'": "RandomLaplaceGPU", + "'Scharr'": "RandomScharrGPU", + "'GaussianBlur'": "RandomGaussianBlurGPU", + "'UnsharpMask'": "RandomUnsharpMaskGPU", + "'RandConv'": "RandomRandConvGPU", +} +#: which kernel-specific parameters each leaf actually reads +LEAF_PARAMS = { + "RandomLaplaceGPU": set(), + "RandomScharrGPU": {"absolute"}, + "RandomGaussianBlurGPU": {"sigma"}, + "RandomUnsharpMaskGPU": {"sigma", "unsharp_amount"}, + "RandomRandConvGPU": {"kernel_sizes"}, +} +KERNEL_SPECIFIC = {"absolute", "sigma", "unsharp_amount", "kernel_sizes"} +IGNORED_PARAMS = {"p_batch"} + + +def _function_fingerprints() -> dict[str, str]: + """Behavioural fingerprint -> leaf class, for the elementwise function transforms. + + The ladder passed lambdas, whose repr carries an address, so the fixture records + what the function does to a probe rather than what it is called. + """ + probe = torch.tensor([0.25, 0.5, 0.75]) + leaves = { + "RandomLog1pGPU": torch.log1p, + "RandomSqrtGPU": torch.sqrt, + "RandomSinGPU": torch.sin, + "RandomExpGPU": torch.exp, + "RandomSigmoidGPU": torch.sigmoid, + } + return {"fn:" + ",".join(f"{x:.6f}" for x in fn(probe).tolist()): name for name, fn in leaves.items()} + + +FUNCTION_LEAF = _function_fingerprints() + + +@contextlib.contextmanager +def record_constructions(): + """Record (class name, effective kwargs) for every transform built inside the block. + + The same instrumentation the fixture was captured with, so the two sides are + measured identically rather than one being re-derived from instance attributes -- + which do not reliably mirror the constructor's parameter names. + """ + import inspect + + modules = [ + importlib.import_module(f"smauglab.transforms.{name}") + for name in ("gpu.contrast", "gpu.spatial", "gpu.fromSeg", "gpu.domain_transfer", "synthseg.transforms") + ] + records: list[tuple[str, dict]] = [] + patched: list[tuple[type, object]] = [] + probe = torch.tensor([0.25, 0.5, 0.75]) + + def describe(value): + if callable(value): + try: + return "fn:" + ",".join(f"{x:.6f}" for x in value(probe).tolist()) + except Exception: + return "fn:" + return repr(value) + + seen: set[type] = set() + for module in modules: + for name, obj in list(vars(module).items()): + if not inspect.isclass(obj) or obj in seen or not issubclass(obj, torch.nn.Module): + continue + if not name.startswith(("Random", "_Random", "Zscore")): + continue + seen.add(obj) + original = obj.__init__ + patched.append((obj, original)) + + def make(original=original): + @functools.wraps(original) + def __init__(self, *args, **kwargs): # noqa: N807 -- it *is* a dunder; we are replacing one + # Leaves inherit __init__ from their base and both are patched, so + # only the outermost call counts. + outermost = not getattr(self, "_recorded", False) + self._recorded = True + try: + bound = inspect.signature(original).bind(self, *args, **kwargs) + bound.apply_defaults() + captured = {k: describe(v) for k, v in list(bound.arguments.items())[1:] if k != "kwargs"} + except Exception: + captured = {} + if outermost: + records.append((type(self).__name__, captured)) + return original(self, *args, **kwargs) + + # the registry reads accepted parameters off the signature + __init__.__signature__ = inspect.signature(original) + return __init__ + + obj.__init__ = make() + try: + yield records + finally: + for cls, original in patched: + cls.__init__ = original + + +def normalise(name: str, kwargs: dict) -> tuple[str, tuple[tuple[str, str], ...]]: + kwargs = dict(kwargs) + if name == "_RandomConvBaseGPU": + name = KERNEL_LEAF[kwargs.pop("kernel_type")] + kwargs = {k: v for k, v in kwargs.items() if k not in KERNEL_SPECIFIC or k in LEAF_PARAMS[name]} + elif name == "_RandomFunctionBaseGPU": + name = FUNCTION_LEAF[kwargs.pop("func")] + elif name == "_RandomGammaBaseGPU": + name = "RandomInvGammaGPU" if kwargs.pop("invert_image", "False") == "True" else "RandomGammaGPU" + kwargs.pop("func", None) + # Sorted, because dict repr is insertion-ordered and the two sides insert in + # different orders. tuple-vs-list is a spelling change in the defaults, not a + # change of value. + return name, tuple(sorted((k, re.sub(r"^\((.*?),?\)$", r"[\1]", v)) for k, v in kwargs.items() if k not in IGNORED_PARAMS)) + + +class TestBuilderMatchesTheOldLadders(SmaugLabTestCase): + def setUp(self): + super().setUp() + self.legacy = json.loads(FIXTURE.read_text()) + + def test_the_fixture_covers_the_shipped_configs(self): + configs = {key.split("|")[0] for key in self.legacy} + self.assertGreaterEqual(len(configs), 20, "the fixture should cover most shipped configs") + + def test_every_recorded_pipeline_builds_the_same_transforms(self): + for key, recorded in self.legacy.items(): + config_name, mode = key.split("|") + with self.subTest(config=config_name, mode=mode): + path = Path("smauglab/configs") / config_name + if not path.is_file(): + self.skipTest(f"{config_name} is not shipped") + config = SmaugConfig.from_path(path) + with record_constructions() as built: + build_gpu_pipeline( + config.section(Backend.GPU), + mode=PipelineMode(mode), + options=config.pipeline_options("random_choose"), + source=config.source, + ) + expected = sorted(str(normalise(n, kw)) for n, kw in recorded) + actual = sorted(str(normalise(n, kw)) for n, kw in built) + self.assertEqual(expected, actual) + + +class TestOrderSource(SmaugLabTestCase): + """Registry order by default; config key order when the config asks for it.""" + + #: Deliberately in the opposite order to PIPELINE_ORDER, so the two sources disagree. + SECTION: ClassVar[dict] = { + "ZscoreNormalizationGPU": {"p": 1.0}, + "RandomFlipTransformGPU": {"p": 1.0}, + } + + def test_registry_order_ignores_the_order_of_the_keys(self): + built = build_transforms(self.SECTION, Backend.GPU) + self.assertEqual([type(t).__name__ for t, _ in built], ["RandomFlipTransformGPU", "ZscoreNormalizationGPU"]) + + def test_config_order_keeps_the_order_of_the_keys(self): + built = build_transforms(self.SECTION, Backend.GPU, order_source=OrderSource.CONFIG) + self.assertEqual([type(t).__name__ for t, _ in built], ["ZscoreNormalizationGPU", "RandomFlipTransformGPU"]) + + def test_the_pipeline_honours_the_config_setting(self): + payload = {"GPU": dict(self.SECTION), "pipeline": {"order": "config"}} + config = SmaugConfig(payload) + built = build_gpu_pipeline(config.section(Backend.GPU), order_source=config.order_source()) + self.assertEqual([type(t).__name__ for t in built], ["ZscoreNormalizationGPU", "RandomFlipTransformGPU"]) + + +class TestValidation(SmaugLabTestCase): + def test_an_unknown_augmentation_stops_the_build(self): + with self.assertRaises(InvalidConfigError): + build_transforms({"NotAThing": {}}, Backend.GPU) + + def test_an_unknown_parameter_stops_the_build(self): + with self.assertRaises(InvalidConfigError): + build_transforms({"RandomFlipTransformGPU": {"nope": 1}}, Backend.GPU) + + def test_comment_keys_are_skipped(self): + built = build_transforms({"_note": "hi", "RandomFlipTransformGPU": {"p": 1.0}}, Backend.GPU) + self.assertEqual(len(built), 1) + + def test_every_problem_is_reported_at_once(self): + with self.assertRaises(InvalidConfigError) as caught: + build_transforms({"Nope": {}, "RandomFlipTransformGPU": {"bad": 1}}, Backend.GPU) + self.assertEqual(len(caught.exception.problems), 2) diff --git a/unit_tests/test_kernel_correctness.py b/unit_tests/test_kernel_correctness.py index dad5817..9124430 100644 --- a/unit_tests/test_kernel_correctness.py +++ b/unit_tests/test_kernel_correctness.py @@ -11,7 +11,7 @@ import torch import torch.nn.functional as F -from smauglab.transforms.cpu.contrast import ConvTransform +from smauglab.transforms.cpu.contrast import LaplaceConvTransform, ScharrConvTransform from smauglab.transforms.kernels import gaussian_kernel1d, gaussian_kernel3d from unit_tests.helpers import SmaugLabTestCase @@ -83,7 +83,7 @@ def test_the_old_uncentred_formula_really_was_off_centre(self): class TestScharrIsAGradientOperator(SmaugLabTestCase): def _kernels(self, spatial_dims: int): image = torch.rand(1, *([8] * spatial_dims)) - return ConvTransform(kernel_type="Scharr").get_parameters(image=image)["kernel"] + return ScharrConvTransform().get_parameters(image=image)["kernel"] def test_every_2d_scharr_kernel_sums_to_zero(self): for axis, kernel in enumerate(self._kernels(2)): @@ -123,5 +123,5 @@ def test_the_laplace_kernels_still_sum_to_zero(self): for spatial_dims in (2, 3): with self.subTest(spatial_dims=spatial_dims): image = torch.rand(1, *([8] * spatial_dims)) - kernel = ConvTransform(kernel_type="Laplace").get_parameters(image=image)["kernel"] + kernel = LaplaceConvTransform().get_parameters(image=image)["kernel"] self.assertAlmostEqual(float(kernel.sum()), 0.0, places=5) From 0ee7441acd64af4d5a7ac3ce2d8b1c8a345b2f4c Mon Sep 17 00:00:00 2001 From: iback Date: Thu, 27 Aug 2026 12:55:16 +0000 Subject: [PATCH 2/2] test: verify all 27 pipelines in CI, not the five that happen to be tracked The equivalence test read each config out of smauglab/configs and skipped when the file was absent. Only five configs are tracked -- .gitignore has a repo-wide *.json to keep per-experiment configs out of the repo -- so on a clean checkout it skipped 22 of its 27 subtests and reported green. The claim "all 27 pipelines match" was true on my machine, where the other 24 configs exist, and unverified everywhere else. It now migrates the tracked legacy fixture in memory instead, which is the comparison that was meant all along: the legacy config as the ladder saw it, against the migrated config as the builder sees it. That also puts migration/migrate.py itself under test on every run. 54 subtests where there were 27 skips, and a new test asserts every fixture entry has a legacy source file -- so a missing config fails rather than quietly skipping, which is what hid this. Co-Authored-By: Claude Opus 5 --- unit_tests/test_builder.py | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/unit_tests/test_builder.py b/unit_tests/test_builder.py index 0ab3f14..55b9629 100644 --- a/unit_tests/test_builder.py +++ b/unit_tests/test_builder.py @@ -34,6 +34,19 @@ class and effective constructor kwargs of every transform the hand-written ladde from unit_tests.helpers import SmaugLabTestCase FIXTURE = Path(__file__).parent / "fixtures" / "legacy_effective_kwargs.json" +LEGACY_CONFIGS = Path(__file__).parent / "fixtures" / "legacy_configs" / "configs" + + +def _migrator(): + """Load migration/migrate.py, which is a repo script rather than a package module.""" + import importlib.util + + path = Path(__file__).resolve().parent.parent / "migration" / "migrate.py" + spec = importlib.util.spec_from_file_location("smauglab_migrate", path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + #: kernel_type value -> the leaf class that replaced it. KERNEL_LEAF = { @@ -161,19 +174,30 @@ class TestBuilderMatchesTheOldLadders(SmaugLabTestCase): def setUp(self): super().setUp() self.legacy = json.loads(FIXTURE.read_text()) + self.migrate = _migrator().migrate def test_the_fixture_covers_the_shipped_configs(self): configs = {key.split("|")[0] for key in self.legacy} self.assertGreaterEqual(len(configs), 20, "the fixture should cover most shipped configs") + def test_every_fixture_config_has_a_legacy_source(self): + """Nothing may be skipped for a missing file: that is what hid 22 of these.""" + for key in self.legacy: + config_name = key.split("|")[0] + with self.subTest(config=config_name): + self.assertTrue((LEGACY_CONFIGS / config_name).is_file(), f"{config_name} is not in the legacy fixtures") + def test_every_recorded_pipeline_builds_the_same_transforms(self): for key, recorded in self.legacy.items(): config_name, mode = key.split("|") with self.subTest(config=config_name, mode=mode): - path = Path("smauglab/configs") / config_name - if not path.is_file(): - self.skipTest(f"{config_name} is not shipped") - config = SmaugConfig.from_path(path) + # Migrated from the tracked legacy fixture rather than read out of + # smauglab/configs: only five of those are tracked (the repo-wide + # *.json in .gitignore keeps per-experiment configs out), so reading + # them there silently skipped 22 of the 27 pipelines in CI. + legacy = json.loads((LEGACY_CONFIGS / config_name).read_text()) + migrated, _ = self.migrate(legacy, source=config_name) + config = SmaugConfig(migrated, source=config_name) with record_constructions() as built: build_gpu_pipeline( config.section(Backend.GPU),