BioMedAI-UCSC / InverseSR

[Early Accepted at MICCAI 2023] Pytorch Code of "InverseSR: 3D Brain MRI Super-Resolution Using a Latent Diffusion Model"
http://arxiv.org/abs/2308.12465
Apache License 2.0
39 stars 6 forks source link

I am confused about the corruption_function #7

Open zwmJohn opened 8 months ago

zwmJohn commented 8 months ago

In the paper, it introduce a corruption function that generates masks for non-acquired slices, enabling our method to in-paint the missing slices. For instance, on 1 × 1 × 4mm3 undersampled volumes, we create masks for three slices every four slices on the generated HR 1 × 1 × 1mm3 volumes.

but I cannot find it in code. I do found a downsample function though, but it downsamples all the planes. `class ForwardDownsample(ForwardAbstract): def init(self, factor): self.factor = factor

# resolution of input x can be anything, but aspect ratio should be 1:1
def __call__(self, x):
    x_down = F.interpolate(
        x,
        scale_factor=1 / self.factor,
        mode="trilinear",
        recompute_scale_factor=True,
        align_corners=False,
    )  # BCHW
    return x_down`
zwmJohn commented 8 months ago

fixed