Skip to content

Super-resolution artifacts

Super-resolution reconstruction algorithms are used commonly in fetal MRI imaging to improve the resolution of the images, due to specifics of fetal (brain) MRI acquisitions (see figure below [1]).

SR Recap

Fig. 1. (A) Illustration of the data acquisition and reconstruction in fetal brain MRI. Stacks of 2D images are acquired at multiple orientations and combined into a single 3D volume using super-resolution reconstruction techniques. Quality control checks are implemented on the stacks of 2D images (Step 1) and on the SRR volume (Step 2). (B) SRR volumes with different quality scores. (C) Example of the different SR artifacts

We implemented a SR artifact simulation framework to generate synthetic fetal brain MRI images with different types of artifacts. To enable it, simply pass corresponding classes described below to the generator class.

You can see examples of its application in the following notebook. It consists of following classes that each implement a specific type(s) of artifacts:

Cortex blur

Default configuration:

blur_cortex:
  _target_: fetalsyngen.generator.augmentation.artifacts.BlurCortex
  prob: 0.4
  cortex_label: 2
  nblur_min: 50
  nblur_max: 200
  sigma_gamma_loc: 3
  sigma_gamma_scale: 1
  std_blur_shape: 2
  std_blur_scale: 1

fetalsyngen.generator.augmentation.artifacts.BlurCortex

Bases: RandTransform

Blurs the cortex in the image (like in cases with imprecise reconstructions). Given a cortex_label, blurs the cortex with a Gaussian blur (shape and scale defined by std_blur_shape and std_blur_scale). Then, generates 3D Gaussian blobs (between nblur_min and nblur_max) with a given width (parametrized by a gamma distribution with parameters sigma_gamma_loc and sigma_gamma_scale) defining where the blurring will be applied.

Source code in fetalsyngen/generator/augmentation/artifacts.py
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
class BlurCortex(RandTransform):
    """Blurs the cortex in the image (like in cases with imprecise reconstructions).
    Given a `cortex_label`,  blurs the cortex with a Gaussian blur (shape and scale defined
    by `std_blur_shape` and `std_blur_scale`). Then, generates 3D Gaussian blobs (between `nblur_min` and `nblur_max`)
    with a given width (parametrized by a gamma distribution with parameters `sigma_gamma_loc` and `sigma_gamma_scale`) defining where the blurring will be applied.
    """

    def __init__(
        self,
        prob: float,
        cortex_label: int,
        nblur_min: int,
        nblur_max: int,
        sigma_gamma_loc: int = 3,
        sigma_gamma_scale: int = 1,
        std_blur_shape: int = 2,
        std_blur_scale: int = 1,
    ):
        """
        Initialize the augmentation parameters.

        Args:
            prob (float): Probability of applying the augmentation.
            cortex_label (int): Label of the cortex in the segmentation.
            nblur_min (int): Minimum number of blurs to apply.
            nblur_max (int): Maximum number of blurs to apply.
            sigma_gamma_loc (int): Location parameter of the gamma distribution for the blurring width.
            sigma_gamma_scale (int): Scale parameter of the gamma distribution for the blurring width.
            std_blur_shape (int): Shape parameter of the gamma distribution defining the Gaussian blur standard deviation.
            std_blur_scale (int): Scale parameter of the gamma distribution defining the Gaussian blur blur standard deviation.
        """
        self.prob = prob
        self.cortex_label = cortex_label
        self.nblur_min = nblur_min
        self.nblur_max = nblur_max
        self.sigma_gamma_loc = sigma_gamma_loc
        self.sigma_gamma_scale = sigma_gamma_scale
        self.std_blur_shape = std_blur_shape
        self.std_blur_scale = std_blur_scale

    def blur_proba(self, shape, cortex, device):
        """
        Generate the probability map for the blurring based on the cortex segmentation.
        This functions puts more probability of a blurring occuring in the frontal region
        of the brain, as observed empirically.
        """
        x, y, z = shape
        # Blurring is more likely to happen in the frontal lobe
        cortex_prob = mog_3d_tensor(
            shape,
            [(0, y, z // 2), (x, y, z // 2)],
            [x // 5, y // 5],
            device,
        )
        idx_cortex = torch.where(cortex > 0)
        cortex_prob = cortex_prob[idx_cortex]
        cortex_prob = cortex_prob / cortex_prob.sum()
        return cortex_prob

    def __call__(
        self, output, seg, device, genparams: dict = {}, **kwargs
    ) -> tuple[torch.Tensor, dict]:
        """Apply the blurring to the input image.

        Args:
            output (torch.Tensor): Input image to resample.
            seg (torch.Tensor): Input segmentation corresponding to the image.
            device (str): Device to use for computation.
            genparams (dict): Generation parameters.
                Default: {}. Should contain the key "spacing" if the spacing is fixed.

        Returns:
            Resampled image  and Metadata containing the blurring parameters.
        """
        if np.random.rand() < self.prob or len(genparams.keys()) > 0:
            nblur = (
                np.random.randint(self.nblur_min, self.nblur_max)
                if "nblur" not in genparams.keys()
                else genparams["nblur"]
            )
            std_blurs = np.random.gamma(self.std_blur_shape, self.std_blur_scale, 3)

            cortex = seg == self.cortex_label
            cortex_prob = self.blur_proba(output.shape, cortex, device)
            # Reshape cortex prob onto to the cortex

            idx = torch.multinomial(cortex_prob, nblur)

            idx_cortex = torch.where(cortex > 0)
            centers = [
                [idx_cortex[i][id.item()].item() for i in range(3)] for id in idx
            ]
            # Spatial merging parameters.
            sigmas = np.random.gamma(
                self.sigma_gamma_loc, self.sigma_gamma_scale, (nblur, 3)
            )
            gaussian = mog_3d_tensor(
                output.shape,
                centers=centers,
                sigmas=sigmas,
                device=output.device,
            )

            # Generate the blurred image
            output_blur = gaussian_blur_3d(
                output.float(), stds=std_blurs, device=output.device
            )
            output = output * (1 - gaussian) + output_blur * gaussian
            return output, {
                "nblur": nblur,
            }

        else:
            return output, {
                "nblur": None,
            }

__init__(prob, cortex_label, nblur_min, nblur_max, sigma_gamma_loc=3, sigma_gamma_scale=1, std_blur_shape=2, std_blur_scale=1)

Initialize the augmentation parameters.

Parameters:

Name Type Description Default
prob float

Probability of applying the augmentation.

required
cortex_label int

Label of the cortex in the segmentation.

required
nblur_min int

Minimum number of blurs to apply.

required
nblur_max int

Maximum number of blurs to apply.

required
sigma_gamma_loc int

Location parameter of the gamma distribution for the blurring width.

3
sigma_gamma_scale int

Scale parameter of the gamma distribution for the blurring width.

1
std_blur_shape int

Shape parameter of the gamma distribution defining the Gaussian blur standard deviation.

2
std_blur_scale int

Scale parameter of the gamma distribution defining the Gaussian blur blur standard deviation.

1
Source code in fetalsyngen/generator/augmentation/artifacts.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def __init__(
    self,
    prob: float,
    cortex_label: int,
    nblur_min: int,
    nblur_max: int,
    sigma_gamma_loc: int = 3,
    sigma_gamma_scale: int = 1,
    std_blur_shape: int = 2,
    std_blur_scale: int = 1,
):
    """
    Initialize the augmentation parameters.

    Args:
        prob (float): Probability of applying the augmentation.
        cortex_label (int): Label of the cortex in the segmentation.
        nblur_min (int): Minimum number of blurs to apply.
        nblur_max (int): Maximum number of blurs to apply.
        sigma_gamma_loc (int): Location parameter of the gamma distribution for the blurring width.
        sigma_gamma_scale (int): Scale parameter of the gamma distribution for the blurring width.
        std_blur_shape (int): Shape parameter of the gamma distribution defining the Gaussian blur standard deviation.
        std_blur_scale (int): Scale parameter of the gamma distribution defining the Gaussian blur blur standard deviation.
    """
    self.prob = prob
    self.cortex_label = cortex_label
    self.nblur_min = nblur_min
    self.nblur_max = nblur_max
    self.sigma_gamma_loc = sigma_gamma_loc
    self.sigma_gamma_scale = sigma_gamma_scale
    self.std_blur_shape = std_blur_shape
    self.std_blur_scale = std_blur_scale

blur_proba(shape, cortex, device)

Generate the probability map for the blurring based on the cortex segmentation. This functions puts more probability of a blurring occuring in the frontal region of the brain, as observed empirically.

Source code in fetalsyngen/generator/augmentation/artifacts.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
def blur_proba(self, shape, cortex, device):
    """
    Generate the probability map for the blurring based on the cortex segmentation.
    This functions puts more probability of a blurring occuring in the frontal region
    of the brain, as observed empirically.
    """
    x, y, z = shape
    # Blurring is more likely to happen in the frontal lobe
    cortex_prob = mog_3d_tensor(
        shape,
        [(0, y, z // 2), (x, y, z // 2)],
        [x // 5, y // 5],
        device,
    )
    idx_cortex = torch.where(cortex > 0)
    cortex_prob = cortex_prob[idx_cortex]
    cortex_prob = cortex_prob / cortex_prob.sum()
    return cortex_prob

__call__(output, seg, device, genparams={}, **kwargs)

Apply the blurring to the input image.

Parameters:

Name Type Description Default
output Tensor

Input image to resample.

required
seg Tensor

Input segmentation corresponding to the image.

required
device str

Device to use for computation.

required
genparams dict

Generation parameters. Default: {}. Should contain the key "spacing" if the spacing is fixed.

{}

Returns:

Type Description
tuple[Tensor, dict]

Resampled image and Metadata containing the blurring parameters.

Source code in fetalsyngen/generator/augmentation/artifacts.py
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
def __call__(
    self, output, seg, device, genparams: dict = {}, **kwargs
) -> tuple[torch.Tensor, dict]:
    """Apply the blurring to the input image.

    Args:
        output (torch.Tensor): Input image to resample.
        seg (torch.Tensor): Input segmentation corresponding to the image.
        device (str): Device to use for computation.
        genparams (dict): Generation parameters.
            Default: {}. Should contain the key "spacing" if the spacing is fixed.

    Returns:
        Resampled image  and Metadata containing the blurring parameters.
    """
    if np.random.rand() < self.prob or len(genparams.keys()) > 0:
        nblur = (
            np.random.randint(self.nblur_min, self.nblur_max)
            if "nblur" not in genparams.keys()
            else genparams["nblur"]
        )
        std_blurs = np.random.gamma(self.std_blur_shape, self.std_blur_scale, 3)

        cortex = seg == self.cortex_label
        cortex_prob = self.blur_proba(output.shape, cortex, device)
        # Reshape cortex prob onto to the cortex

        idx = torch.multinomial(cortex_prob, nblur)

        idx_cortex = torch.where(cortex > 0)
        centers = [
            [idx_cortex[i][id.item()].item() for i in range(3)] for id in idx
        ]
        # Spatial merging parameters.
        sigmas = np.random.gamma(
            self.sigma_gamma_loc, self.sigma_gamma_scale, (nblur, 3)
        )
        gaussian = mog_3d_tensor(
            output.shape,
            centers=centers,
            sigmas=sigmas,
            device=output.device,
        )

        # Generate the blurred image
        output_blur = gaussian_blur_3d(
            output.float(), stds=std_blurs, device=output.device
        )
        output = output * (1 - gaussian) + output_blur * gaussian
        return output, {
            "nblur": nblur,
        }

    else:
        return output, {
            "nblur": None,
        }

Skull stripping artifacts

Default configuration:

  _target_: fetalsyngen.generator.augmentation.artifacts.SimulatedBoundaries
  prob_no_mask: 0.5
  prob_if_mask_halo: 0.5
  prob_if_mask_fuzzy: 0.5

fetalsyngen.generator.augmentation.artifacts.SimulatedBoundaries

Bases: RandTransform

Simulates various types of boundaries in the image, either doing no masking (with probability prob_no_mask), adding a halo around the mask (with probability prob_if_mask_halo), or adding fuzzy boundaries to the mask (with probability prob_if_mask_fuzzy).

Source code in fetalsyngen/generator/augmentation/artifacts.py
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
class SimulatedBoundaries(RandTransform):
    """
    Simulates various types of boundaries in the image, either doing no masking
    (with probability `prob_no_mask`), adding a halo around the mask (with probability
    `prob_if_mask_halo`), or adding fuzzy boundaries to the mask (with probability `prob_if_mask_fuzzy`).
    """

    def __init__(
        self,
        prob_no_mask: float,
        prob_if_mask_halo: float,
        prob_if_mask_fuzzy: float,
    ):
        """
        Initialize the augmentation parameters.

        Args:
            prob_no_mask (float): Probability of not applying any mask.
            prob_if_mask_halo (float): Probability of applying a halo around the mask (in case masking is enabled).
            prob_if_mask_fuzzy (float): Probability of applying fuzzy boundaries to the mask (in case masking is enabled).


        """
        self.prob_no_mask = prob_no_mask
        self.prob_halo = prob_if_mask_halo
        self.prob_fuzzy = prob_if_mask_fuzzy
        self.reset_seeds()

    def reset_seeds(self):
        """
        Reset the seeds for the augmentation.
        """
        self.no_mask_on = None
        self.halo_on = None
        self.halo_radius = None
        self.fuzzy_on = None
        self.n_generate_fuzzy = None
        self.n_centers = None
        self.base_sigma = None

    def sample_seeds(self):
        """
        Sample the seeds for the augmentation.
        """
        self.reset_seeds()
        self.no_mask_on = np.random.rand() < self.prob_no_mask
        if not self.no_mask_on:
            self.halo_on = np.random.rand() < self.prob_halo
            if self.halo_on:
                self.halo_radius = np.random.randint(5, 15)
            self.fuzzy_on = np.random.rand() < self.prob_fuzzy
            if self.fuzzy_on:
                self.n_generate_fuzzy = np.random.randint(2, 5)
                self.n_centers = np.random.poisson(100)
                self.base_sigma = np.random.poisson(8)

    def build_halo(self, mask, radius) -> torch.Tensor:
        """
        Build a halo around the mask with a given radius.

        Args:
            mask (torch.Tensor): Input mask.
            radius (int): Radius of the halo.

        Returns:
            Mask with the halo.
        """
        device = mask.device
        kernel = torch.tensor(ball(radius)).float().to(device).unsqueeze(0).unsqueeze(0)
        mask = mask.float().view(1, 1, *mask.shape[-3:])
        mask = torch.nn.functional.conv3d(mask, kernel, padding="same")
        return (mask > 0).int().view(*mask.shape[-3:])

    def generate_fuzzy_boundaries(
        self, mask, kernel_size=7, threshold_filter=3
    ) -> torch.Tensor:
        """
        Generate fuzzy boundaries around the mask.

        Args:
            mask (torch.Tensor): Input mask.
            kernel_size (int): Size of the kernel for the dilation.
            threshold_filter (int): Threshold for the count of neighboring voxels.

        Returns:
            Mask with fuzzy boundaries.
        """
        shape = mask.shape
        diff = (dilate(mask, kernel_size) - mask).view(shape[-3:])
        non_zero = diff.nonzero(as_tuple=True)
        idx = torch.randperm(len(non_zero[0]))[: int(len(non_zero[0]) * 0.9)]
        idx = (non_zero[0][idx], non_zero[1][idx], non_zero[2][idx])
        diff[idx] = 0

        dsamp = (apply_kernel(diff).squeeze() > threshold_filter).bool()
        closing = erode(dilate(torch.clamp(mask + dsamp, 0, 1), 5), 5)
        return closing.view(shape)

    def __call__(
        self, output, seg, device, genparams: dict = {}, **kwargs
    ) -> tuple[torch.Tensor, dict]:
        """
        Apply the simulated boundaries to the input image.

        Args:
            output (torch.Tensor): Input image to resample.
            seg (torch.Tensor): Input segmentation corresponding to the image.
            device (str): Device to use for computation.
            genparams (dict): Generation parameters.

        Returns:
            Image with structured noise and metadata containing the structured noise parameters.

        """
        device = seg.device
        mask = (seg > 0).int()
        mask = mask.clone()

        self.sample_seeds()
        metadata = {
            "no_mask_on": self.no_mask_on,
            "halo_on": self.halo_on,
            "fuzzy_on": self.fuzzy_on,
        }

        if self.no_mask_on:
            return output, metadata
        if self.halo_on:
            mask = self.build_halo(mask, self.halo_radius)

        if self.fuzzy_on:
            # Generate fuzzy boundaries for the mask
            mask_modif = mask.clone()
            for _ in range(self.n_generate_fuzzy):
                mask_modif = self.generate_fuzzy_boundaries(mask_modif)

            # Sample centers in the voxels that have been added
            # with a MoG

            surf = torch.where((mask_modif - mask).squeeze() > 0)
            idx = torch.randperm(surf[0].shape[0])[: self.n_centers]
            centers = [(surf[0][i], surf[1][i], surf[2][i]) for i in idx]
            sigmas = [
                self.base_sigma + 10 * np.random.beta(2, 5) for _ in range(len(centers))
            ]
            mog = mog_3d_tensor(
                mask_modif.shape[-3:],
                centers=centers,
                sigmas=sigmas,
                device=device,
            ).view(1, 1, *mask_modif.shape[-3:])

            # Generate the probability map for the surface

            surf_proba = torch.zeros_like(mog[0, 0]).float()
            surf_proba[surf] = mog[0, 0][surf]
            # Generate kernel_size-1 x n_generate_fuzzy -1 dilations
            # Roughly matches the width of the generated halo
            n_dilate = 6 * (self.n_generate_fuzzy - 1)

            # Then, generate more realistic boundaries by making the
            # boundary of the bask more or less large according to the
            # probability map.
            dilate_stack = [mask] * 2
            for i in range(n_dilate - 2):
                dilate_stack.append(self.build_halo(dilate_stack[-1], 1))

            # Generate a stack of dilations intersected with the mask
            dilate_stack = torch.stack(dilate_stack, 0) * mask_modif.view(
                1, *mask_modif.shape[-3:]
            )

            surf_proba = torch.clamp(
                (surf_proba * len(dilate_stack) - 1).round().int(), 0, None
            )

            # Generate the final mask with the fuzzily generated boundaries
            # and also randomized halos.
            one_hot = torch.nn.functional.one_hot(
                surf_proba.to(torch.int64), num_classes=len(dilate_stack)
            ).int()
            dilate_stack = dilate_stack.permute(1, 2, 3, 0).int()
            mask = (one_hot * dilate_stack).sum(-1)
        return output * mask, metadata

__init__(prob_no_mask, prob_if_mask_halo, prob_if_mask_fuzzy)

Initialize the augmentation parameters.

Parameters:

Name Type Description Default
prob_no_mask float

Probability of not applying any mask.

required
prob_if_mask_halo float

Probability of applying a halo around the mask (in case masking is enabled).

required
prob_if_mask_fuzzy float

Probability of applying fuzzy boundaries to the mask (in case masking is enabled).

required
Source code in fetalsyngen/generator/augmentation/artifacts.py
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
def __init__(
    self,
    prob_no_mask: float,
    prob_if_mask_halo: float,
    prob_if_mask_fuzzy: float,
):
    """
    Initialize the augmentation parameters.

    Args:
        prob_no_mask (float): Probability of not applying any mask.
        prob_if_mask_halo (float): Probability of applying a halo around the mask (in case masking is enabled).
        prob_if_mask_fuzzy (float): Probability of applying fuzzy boundaries to the mask (in case masking is enabled).


    """
    self.prob_no_mask = prob_no_mask
    self.prob_halo = prob_if_mask_halo
    self.prob_fuzzy = prob_if_mask_fuzzy
    self.reset_seeds()

reset_seeds()

Reset the seeds for the augmentation.

Source code in fetalsyngen/generator/augmentation/artifacts.py
400
401
402
403
404
405
406
407
408
409
410
def reset_seeds(self):
    """
    Reset the seeds for the augmentation.
    """
    self.no_mask_on = None
    self.halo_on = None
    self.halo_radius = None
    self.fuzzy_on = None
    self.n_generate_fuzzy = None
    self.n_centers = None
    self.base_sigma = None

sample_seeds()

Sample the seeds for the augmentation.

Source code in fetalsyngen/generator/augmentation/artifacts.py
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
def sample_seeds(self):
    """
    Sample the seeds for the augmentation.
    """
    self.reset_seeds()
    self.no_mask_on = np.random.rand() < self.prob_no_mask
    if not self.no_mask_on:
        self.halo_on = np.random.rand() < self.prob_halo
        if self.halo_on:
            self.halo_radius = np.random.randint(5, 15)
        self.fuzzy_on = np.random.rand() < self.prob_fuzzy
        if self.fuzzy_on:
            self.n_generate_fuzzy = np.random.randint(2, 5)
            self.n_centers = np.random.poisson(100)
            self.base_sigma = np.random.poisson(8)

build_halo(mask, radius)

Build a halo around the mask with a given radius.

Parameters:

Name Type Description Default
mask Tensor

Input mask.

required
radius int

Radius of the halo.

required

Returns:

Type Description
Tensor

Mask with the halo.

Source code in fetalsyngen/generator/augmentation/artifacts.py
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
def build_halo(self, mask, radius) -> torch.Tensor:
    """
    Build a halo around the mask with a given radius.

    Args:
        mask (torch.Tensor): Input mask.
        radius (int): Radius of the halo.

    Returns:
        Mask with the halo.
    """
    device = mask.device
    kernel = torch.tensor(ball(radius)).float().to(device).unsqueeze(0).unsqueeze(0)
    mask = mask.float().view(1, 1, *mask.shape[-3:])
    mask = torch.nn.functional.conv3d(mask, kernel, padding="same")
    return (mask > 0).int().view(*mask.shape[-3:])

generate_fuzzy_boundaries(mask, kernel_size=7, threshold_filter=3)

Generate fuzzy boundaries around the mask.

Parameters:

Name Type Description Default
mask Tensor

Input mask.

required
kernel_size int

Size of the kernel for the dilation.

7
threshold_filter int

Threshold for the count of neighboring voxels.

3

Returns:

Type Description
Tensor

Mask with fuzzy boundaries.

Source code in fetalsyngen/generator/augmentation/artifacts.py
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
def generate_fuzzy_boundaries(
    self, mask, kernel_size=7, threshold_filter=3
) -> torch.Tensor:
    """
    Generate fuzzy boundaries around the mask.

    Args:
        mask (torch.Tensor): Input mask.
        kernel_size (int): Size of the kernel for the dilation.
        threshold_filter (int): Threshold for the count of neighboring voxels.

    Returns:
        Mask with fuzzy boundaries.
    """
    shape = mask.shape
    diff = (dilate(mask, kernel_size) - mask).view(shape[-3:])
    non_zero = diff.nonzero(as_tuple=True)
    idx = torch.randperm(len(non_zero[0]))[: int(len(non_zero[0]) * 0.9)]
    idx = (non_zero[0][idx], non_zero[1][idx], non_zero[2][idx])
    diff[idx] = 0

    dsamp = (apply_kernel(diff).squeeze() > threshold_filter).bool()
    closing = erode(dilate(torch.clamp(mask + dsamp, 0, 1), 5), 5)
    return closing.view(shape)

__call__(output, seg, device, genparams={}, **kwargs)

Apply the simulated boundaries to the input image.

Parameters:

Name Type Description Default
output Tensor

Input image to resample.

required
seg Tensor

Input segmentation corresponding to the image.

required
device str

Device to use for computation.

required
genparams dict

Generation parameters.

{}

Returns:

Type Description
tuple[Tensor, dict]

Image with structured noise and metadata containing the structured noise parameters.

Source code in fetalsyngen/generator/augmentation/artifacts.py
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
def __call__(
    self, output, seg, device, genparams: dict = {}, **kwargs
) -> tuple[torch.Tensor, dict]:
    """
    Apply the simulated boundaries to the input image.

    Args:
        output (torch.Tensor): Input image to resample.
        seg (torch.Tensor): Input segmentation corresponding to the image.
        device (str): Device to use for computation.
        genparams (dict): Generation parameters.

    Returns:
        Image with structured noise and metadata containing the structured noise parameters.

    """
    device = seg.device
    mask = (seg > 0).int()
    mask = mask.clone()

    self.sample_seeds()
    metadata = {
        "no_mask_on": self.no_mask_on,
        "halo_on": self.halo_on,
        "fuzzy_on": self.fuzzy_on,
    }

    if self.no_mask_on:
        return output, metadata
    if self.halo_on:
        mask = self.build_halo(mask, self.halo_radius)

    if self.fuzzy_on:
        # Generate fuzzy boundaries for the mask
        mask_modif = mask.clone()
        for _ in range(self.n_generate_fuzzy):
            mask_modif = self.generate_fuzzy_boundaries(mask_modif)

        # Sample centers in the voxels that have been added
        # with a MoG

        surf = torch.where((mask_modif - mask).squeeze() > 0)
        idx = torch.randperm(surf[0].shape[0])[: self.n_centers]
        centers = [(surf[0][i], surf[1][i], surf[2][i]) for i in idx]
        sigmas = [
            self.base_sigma + 10 * np.random.beta(2, 5) for _ in range(len(centers))
        ]
        mog = mog_3d_tensor(
            mask_modif.shape[-3:],
            centers=centers,
            sigmas=sigmas,
            device=device,
        ).view(1, 1, *mask_modif.shape[-3:])

        # Generate the probability map for the surface

        surf_proba = torch.zeros_like(mog[0, 0]).float()
        surf_proba[surf] = mog[0, 0][surf]
        # Generate kernel_size-1 x n_generate_fuzzy -1 dilations
        # Roughly matches the width of the generated halo
        n_dilate = 6 * (self.n_generate_fuzzy - 1)

        # Then, generate more realistic boundaries by making the
        # boundary of the bask more or less large according to the
        # probability map.
        dilate_stack = [mask] * 2
        for i in range(n_dilate - 2):
            dilate_stack.append(self.build_halo(dilate_stack[-1], 1))

        # Generate a stack of dilations intersected with the mask
        dilate_stack = torch.stack(dilate_stack, 0) * mask_modif.view(
            1, *mask_modif.shape[-3:]
        )

        surf_proba = torch.clamp(
            (surf_proba * len(dilate_stack) - 1).round().int(), 0, None
        )

        # Generate the final mask with the fuzzily generated boundaries
        # and also randomized halos.
        one_hot = torch.nn.functional.one_hot(
            surf_proba.to(torch.int64), num_classes=len(dilate_stack)
        ).int()
        dilate_stack = dilate_stack.permute(1, 2, 3, 0).int()
        mask = (one_hot * dilate_stack).sum(-1)
    return output * mask, metadata

Structural noise

Default configuration:

struct_noise:
  _target_: fetalsyngen.generator.augmentation.artifacts.StructNoise
  prob: 0.4
  wm_label: 3
  std_min: 0.2
  std_max: 0.4
  nloc_min: 5
  nloc_max: 15

fetalsyngen.generator.augmentation.artifacts.StructNoise

Bases: RandTransform

Adds a structured noise to the white matter in the image, similar to what can be seen with NeSVoR reconstructions without prior denoising.

Given a wm_label, generates a multi-scale noise (between nstages_min and nstages_max stages) with a standard deviation between std_min and std_max.

The noise is then added in a spatially varying manner at nloc locations ( between n_loc_min and n_loc_max locations) in the white matter. The merging is done as a weighted sum of the original image and the noisy image, with the weights defined by a MoG with centers at the nloc locations and sigmas defined by sigma_mu and sigma_std.

Source code in fetalsyngen/generator/augmentation/artifacts.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
class StructNoise(RandTransform):
    """Adds a structured noise to the white matter in the image, similar to
    what can be seen with NeSVoR reconstructions without prior denoising.

    Given a `wm_label`, generates a multi-scale noise (between `nstages_min` and `nstages_max` stages)
    with a standard deviation between `std_min` and `std_max`.

    The noise is then added in a spatially varying manner at `nloc` locations (
    between `n_loc_min` and `n_loc_max` locations) in the white matter. The merging
    is done as a weighted sum of the original image and the noisy image, with the weights
    defined by a MoG with centers at the `nloc` locations and sigmas defined by `sigma_mu` and
    `sigma_std`.
    """

    ### TO REFACTOR: THIS IS PERLIN NOISE
    def __init__(
        self,
        prob: float,
        wm_label: int,
        std_min: float,
        std_max: float,
        nloc_min: int,
        nloc_max: int,
        nstages_min: int = 1,
        nstages_max: int = 5,
        sigma_mu: int = 25,
        sigma_std: int = 5,
    ):
        """
        Initialize the augmentation parameters.

        Args:
            prob (float): Probability of applying the augmentation.
            wm_label (int): Label of the white matter in the segmentation.
            std_min (float): Minimum standard deviation of the noise.
            std_max (float): Maximum standard deviation of the noise.
            nloc_min (int): Minimum number of locations to add noise.
            nloc_max (int): Maximum number of locations to add noise.
            nstages_min (int): Minimum number of stages for the noise.
            nstages_max (int): Maximum number of stages for the noise.
            sigma_mu (int): Mean of the sigmas for the MoG.
            sigma_std (int): Standard deviation of the sigmas for the MoG.

        """
        self.prob = prob
        self.wm_label = wm_label
        self.nstages_min = nstages_min
        self.nstages_max = nstages_max
        self.std_min = std_min
        self.std_max = std_max
        self.nloc_min = nloc_min
        self.nloc_max = nloc_max
        self.sigma_mu = sigma_mu
        self.sigma_std = sigma_std

    def __call__(
        self, output, seg, device, genparams: dict = {}, **kwargs
    ) -> tuple[torch.Tensor, dict]:
        """
        Apply the structured noise to the input image.

        Args:
            output (torch.Tensor): Input image to resample.
            seg (torch.Tensor): Input segmentation corresponding to the image.
            device (str): Device to use for computation.
            genparams (dict): Generation parameters.

        Returns:
            Image with structured noise and metadata containing the structured noise parameters.
        """
        if np.random.rand() < self.prob or "nloc" in genparams.keys():
            ## Parameters
            nstages = (
                np.random.randint(self.nstages_min, self.nstages_max)
                if "nstages" not in genparams
                else genparams["nstages"]
            )
            noise_std = self.std_min + (self.std_max - self.std_min) * np.random.rand()
            nloc = (
                np.random.randint(
                    self.nloc_min,
                    self.nloc_max,
                )
                if "nloc" not in genparams
                else genparams["nloc"]
            )
            ##

            wm = seg == self.wm_label
            idx_wm = torch.nonzero(wm, as_tuple=True)
            idx = torch.randint(0, len(idx_wm[0]), (nloc,))
            mask = (seg > 0).int()
            # Add multiscale noise. Start with a small tensor and add the noise to it.
            lr_gaussian_noise = torch.zeros(
                [i // 2**nstages for i in output.shape]
            ).to(device)

            for k in range(nstages):
                shape = [i // 2 ** (nstages - k) for i in output.shape]
                next_shape = [i // 2 ** (nstages - 1 - k) for i in output.shape]
                lr_gaussian_noise += torch.randn(shape).to(device)
                lr_gaussian_noise = torch.nn.functional.interpolate(
                    lr_gaussian_noise.unsqueeze(0).unsqueeze(0),
                    size=next_shape,
                    mode="trilinear",
                    align_corners=False,
                ).squeeze()

            lr_gaussian_noise = lr_gaussian_noise / torch.max(abs(lr_gaussian_noise))
            output_noisy = torch.clamp(
                output + noise_std * lr_gaussian_noise, 0, output.max() * 2
            )

            sigmas = (
                (
                    torch.clamp(
                        self.sigma_mu + self.sigma_std * torch.randn(len(idx)),
                        1,
                        40,
                    )
                )
                .cpu()
                .numpy()
            )
            centers = [
                (
                    idx_wm[0][id].item(),
                    idx_wm[1][id].item(),
                    idx_wm[2][id].item(),
                )
                for id in idx
            ]
            gaussian = mog_3d_tensor(
                output.shape, centers=centers, sigmas=sigmas, device=device
            )

            output = output * (1 - mask) + mask * (
                gaussian * output_noisy + (1 - gaussian) * output
            )

            args = {
                "nstages": nstages,
                "noise_std": noise_std,
                "nloc": nloc,
            }

            return output, args
        else:
            return output, {}

__init__(prob, wm_label, std_min, std_max, nloc_min, nloc_max, nstages_min=1, nstages_max=5, sigma_mu=25, sigma_std=5)

Initialize the augmentation parameters.

Parameters:

Name Type Description Default
prob float

Probability of applying the augmentation.

required
wm_label int

Label of the white matter in the segmentation.

required
std_min float

Minimum standard deviation of the noise.

required
std_max float

Maximum standard deviation of the noise.

required
nloc_min int

Minimum number of locations to add noise.

required
nloc_max int

Maximum number of locations to add noise.

required
nstages_min int

Minimum number of stages for the noise.

1
nstages_max int

Maximum number of stages for the noise.

5
sigma_mu int

Mean of the sigmas for the MoG.

25
sigma_std int

Standard deviation of the sigmas for the MoG.

5
Source code in fetalsyngen/generator/augmentation/artifacts.py
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
def __init__(
    self,
    prob: float,
    wm_label: int,
    std_min: float,
    std_max: float,
    nloc_min: int,
    nloc_max: int,
    nstages_min: int = 1,
    nstages_max: int = 5,
    sigma_mu: int = 25,
    sigma_std: int = 5,
):
    """
    Initialize the augmentation parameters.

    Args:
        prob (float): Probability of applying the augmentation.
        wm_label (int): Label of the white matter in the segmentation.
        std_min (float): Minimum standard deviation of the noise.
        std_max (float): Maximum standard deviation of the noise.
        nloc_min (int): Minimum number of locations to add noise.
        nloc_max (int): Maximum number of locations to add noise.
        nstages_min (int): Minimum number of stages for the noise.
        nstages_max (int): Maximum number of stages for the noise.
        sigma_mu (int): Mean of the sigmas for the MoG.
        sigma_std (int): Standard deviation of the sigmas for the MoG.

    """
    self.prob = prob
    self.wm_label = wm_label
    self.nstages_min = nstages_min
    self.nstages_max = nstages_max
    self.std_min = std_min
    self.std_max = std_max
    self.nloc_min = nloc_min
    self.nloc_max = nloc_max
    self.sigma_mu = sigma_mu
    self.sigma_std = sigma_std

__call__(output, seg, device, genparams={}, **kwargs)

Apply the structured noise to the input image.

Parameters:

Name Type Description Default
output Tensor

Input image to resample.

required
seg Tensor

Input segmentation corresponding to the image.

required
device str

Device to use for computation.

required
genparams dict

Generation parameters.

{}

Returns:

Type Description
tuple[Tensor, dict]

Image with structured noise and metadata containing the structured noise parameters.

Source code in fetalsyngen/generator/augmentation/artifacts.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
def __call__(
    self, output, seg, device, genparams: dict = {}, **kwargs
) -> tuple[torch.Tensor, dict]:
    """
    Apply the structured noise to the input image.

    Args:
        output (torch.Tensor): Input image to resample.
        seg (torch.Tensor): Input segmentation corresponding to the image.
        device (str): Device to use for computation.
        genparams (dict): Generation parameters.

    Returns:
        Image with structured noise and metadata containing the structured noise parameters.
    """
    if np.random.rand() < self.prob or "nloc" in genparams.keys():
        ## Parameters
        nstages = (
            np.random.randint(self.nstages_min, self.nstages_max)
            if "nstages" not in genparams
            else genparams["nstages"]
        )
        noise_std = self.std_min + (self.std_max - self.std_min) * np.random.rand()
        nloc = (
            np.random.randint(
                self.nloc_min,
                self.nloc_max,
            )
            if "nloc" not in genparams
            else genparams["nloc"]
        )
        ##

        wm = seg == self.wm_label
        idx_wm = torch.nonzero(wm, as_tuple=True)
        idx = torch.randint(0, len(idx_wm[0]), (nloc,))
        mask = (seg > 0).int()
        # Add multiscale noise. Start with a small tensor and add the noise to it.
        lr_gaussian_noise = torch.zeros(
            [i // 2**nstages for i in output.shape]
        ).to(device)

        for k in range(nstages):
            shape = [i // 2 ** (nstages - k) for i in output.shape]
            next_shape = [i // 2 ** (nstages - 1 - k) for i in output.shape]
            lr_gaussian_noise += torch.randn(shape).to(device)
            lr_gaussian_noise = torch.nn.functional.interpolate(
                lr_gaussian_noise.unsqueeze(0).unsqueeze(0),
                size=next_shape,
                mode="trilinear",
                align_corners=False,
            ).squeeze()

        lr_gaussian_noise = lr_gaussian_noise / torch.max(abs(lr_gaussian_noise))
        output_noisy = torch.clamp(
            output + noise_std * lr_gaussian_noise, 0, output.max() * 2
        )

        sigmas = (
            (
                torch.clamp(
                    self.sigma_mu + self.sigma_std * torch.randn(len(idx)),
                    1,
                    40,
                )
            )
            .cpu()
            .numpy()
        )
        centers = [
            (
                idx_wm[0][id].item(),
                idx_wm[1][id].item(),
                idx_wm[2][id].item(),
            )
            for id in idx
        ]
        gaussian = mog_3d_tensor(
            output.shape, centers=centers, sigmas=sigmas, device=device
        )

        output = output * (1 - mask) + mask * (
            gaussian * output_noisy + (1 - gaussian) * output
        )

        args = {
            "nstages": nstages,
            "noise_std": noise_std,
            "nloc": nloc,
        }

        return output, args
    else:
        return output, {}

Default configuration:

simulate_motion:
  _target_: fetalsyngen.generator.augmentation.artifacts.SimulateMotion
  prob: 0.4
  scanner_params:
    _target_: fetalsyngen.generator.artifacts.utils.ScannerParams
    resolution_slice_fac_min: 0.5
    resolution_slice_fac_max: 2
    resolution_slice_max: 1.5
    slice_thickness_min: 1.5
    slice_thickness_max: 3.5
    gap_min: 1.5
    gap_max: 5.5
    min_num_stack: 2
    max_num_stack: 6
    max_num_slices: 250
    noise_sigma_min: 0
    noise_sigma_max: 0.1
    TR_min: 1
    TR_max: 2
    prob_gamma: 0.1
    gamma_std: 0.05
    prob_void: 0.2
    slice_size: null
    restrict_transform: False
    txy: 3.0

  recon_params:
    _target_: fetalsyngen.generator.artifacts.utils.ReconParams
    prob_misreg_slice: 0.08
    slices_misreg_ratio: 0.1
    prob_misreg_stack: 0.08
    txy: 3.0
    prob_merge: 0.8
    merge_ngaussians_min: 2
    merge_ngaussians_max: 4
    prob_smooth: 0.2
    prob_rm_slices: 0.3
    rm_slices_min: 0.1
    rm_slices_max: 0.4

fetalsyngen.generator.augmentation.artifacts.SimulateMotion

Bases: RandTransform

Simulates motion in the image by simulating low-resolution slices (based on the scanner_params and then doing a simple point-spread function based on the low-resolution slices (using recon_params).

Source code in fetalsyngen/generator/augmentation/artifacts.py
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
class SimulateMotion(RandTransform):
    """
    Simulates motion in the image by simulating low-resolution slices (based
    on the `scanner_params` and then doing a simple point-spread function based
    on the low-resolution slices (using `recon_params`).
    """

    def __init__(
        self,
        prob: float,
        scanner_params: ScannerParams,
        recon_params: ReconParams,
    ):
        """
        Initialize the augmentation parameters.

        Args:
            prob (float): Probability of applying the augmentation.
            scanner_params (ScannerParams): Dataclass of parameters for the scanner.
            recon_params (ReconParams): Dataclass of parameters for the reconstructor.

        """
        self.scanner_args = scanner_params
        self.recon_args = recon_params
        self.prob = prob

    def __call__(
        self, output, seg, device, genparams: dict = {}, **kwargs
    ) -> tuple[torch.Tensor, dict]:
        """
        Apply the motion simulation to the input image.

        Args:
            output (torch.Tensor): Input image to resample.
            seg (torch.Tensor): Input segmentation corresponding to the image.
            device (str): Device to use for computation.
            genparams (dict): Generation parameters.

        Returns:
            Image with simulated motion and metadata containing the motion simulation parameters.
        """
        # def _artifact_simulate_motion(self, im, seg, generator_params, res):

        if np.random.rand() < self.prob:
            device = output.device
            dshape = (1, 1, *output.shape[-3:])
            res = kwargs["resolution"]
            res_ = np.float64(res[0])
            metadata = {}
            d = {
                "resolution": res_,
                "volume": output.view(dshape).float().to(device),
                "mask": (seg > 0).view(dshape).float().to(device),
                "seg": seg.view(dshape).float().to(device),
                "affine": torch.diag(torch.tensor(list(res) + [1])).to(device),
                "threshold": 0.1,
            }
            self.scanner_args.resolution_recon = res_
            scanner = Scanner(**asdict(self.scanner_args))
            d_scan = scanner.scan(d)

            recon = PSFReconstructor(**asdict(self.recon_args))
            output, _ = recon.recon_psf(d_scan)

            metadata.update(
                {
                    "resolution_recon": d_scan["resolution_recon"],
                    "resolution_slice": d_scan["resolution_slice"],
                    "slice_thickness": d_scan["slice_thickness"],
                    "gap": d_scan["gap"],
                    "nstacks": len(torch.unique(d_scan["positions"][:, 1])),
                }
            )
            metadata.update(recon.get_seeds())

            return output.squeeze(), metadata
        else:
            return output, {}

__init__(prob, scanner_params, recon_params)

Initialize the augmentation parameters.

Parameters:

Name Type Description Default
prob float

Probability of applying the augmentation.

required
scanner_params ScannerParams

Dataclass of parameters for the scanner.

required
recon_params ReconParams

Dataclass of parameters for the reconstructor.

required
Source code in fetalsyngen/generator/augmentation/artifacts.py
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
def __init__(
    self,
    prob: float,
    scanner_params: ScannerParams,
    recon_params: ReconParams,
):
    """
    Initialize the augmentation parameters.

    Args:
        prob (float): Probability of applying the augmentation.
        scanner_params (ScannerParams): Dataclass of parameters for the scanner.
        recon_params (ReconParams): Dataclass of parameters for the reconstructor.

    """
    self.scanner_args = scanner_params
    self.recon_args = recon_params
    self.prob = prob

__call__(output, seg, device, genparams={}, **kwargs)

Apply the motion simulation to the input image.

Parameters:

Name Type Description Default
output Tensor

Input image to resample.

required
seg Tensor

Input segmentation corresponding to the image.

required
device str

Device to use for computation.

required
genparams dict

Generation parameters.

{}

Returns:

Type Description
tuple[Tensor, dict]

Image with simulated motion and metadata containing the motion simulation parameters.

Source code in fetalsyngen/generator/augmentation/artifacts.py
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
def __call__(
    self, output, seg, device, genparams: dict = {}, **kwargs
) -> tuple[torch.Tensor, dict]:
    """
    Apply the motion simulation to the input image.

    Args:
        output (torch.Tensor): Input image to resample.
        seg (torch.Tensor): Input segmentation corresponding to the image.
        device (str): Device to use for computation.
        genparams (dict): Generation parameters.

    Returns:
        Image with simulated motion and metadata containing the motion simulation parameters.
    """
    # def _artifact_simulate_motion(self, im, seg, generator_params, res):

    if np.random.rand() < self.prob:
        device = output.device
        dshape = (1, 1, *output.shape[-3:])
        res = kwargs["resolution"]
        res_ = np.float64(res[0])
        metadata = {}
        d = {
            "resolution": res_,
            "volume": output.view(dshape).float().to(device),
            "mask": (seg > 0).view(dshape).float().to(device),
            "seg": seg.view(dshape).float().to(device),
            "affine": torch.diag(torch.tensor(list(res) + [1])).to(device),
            "threshold": 0.1,
        }
        self.scanner_args.resolution_recon = res_
        scanner = Scanner(**asdict(self.scanner_args))
        d_scan = scanner.scan(d)

        recon = PSFReconstructor(**asdict(self.recon_args))
        output, _ = recon.recon_psf(d_scan)

        metadata.update(
            {
                "resolution_recon": d_scan["resolution_recon"],
                "resolution_slice": d_scan["resolution_slice"],
                "slice_thickness": d_scan["slice_thickness"],
                "gap": d_scan["gap"],
                "nstacks": len(torch.unique(d_scan["positions"][:, 1])),
            }
        )
        metadata.update(recon.get_seeds())

        return output.squeeze(), metadata
    else:
        return output, {}

References

  1. Sanchez, Thomas, et al. "Assessing data quality on fetal brain MRI reconstruction: a multi-site and multi-rater study." International Workshop on Preterm, Perinatal and Paediatric Image Analysis. Cham: Springer Nature Switzerland, 2024.