MECLabTUDA / VIMH

5 stars 0 forks source link

Question on OOD Dataset Creation #1

Closed SouLeo closed 4 months ago

SouLeo commented 1 year ago

Hello,

I've been exploring your construction of the OOD BRATS test set, but I'm slightly confused between what's reported in the paper and what's present in the brats.py file.

Specifically, in Section 4. and Appendix A. in the paper, you mention that the four augmentations you apply are

  1. Motion
  2. Ghosting
  3. Noise
  4. Spikes

But in brats.py there are imports for RandomBiasField, RandomSpike, RandomMotion, RandomGhosting. What confuses me is if I should assume Noise=RandomBiasField in the torchio library.

I ask because you parameterize the Noise using gaussian means and standard deviations in the paper (which sounds more like using the torchio RandomNoise function) whereas the RandomBiasField method is parameterized by polynomial coefficients.

I am not a domain expert, so I appreciate your patience and time reviewing this question. Thank you so much!

SouLeo commented 1 year ago

Hello, sorry to bother you again with another question, but I don't think I understand what is the expected variable type of either self.fullAugmentation or self.patchAugmentation in the BRATS3D() dataset class. Do you mind providing some example of how this code is used?

I have naively tried to set

self.fullAugmentation = tio.RandomMotion(degrees=20, translation=12) however this breaks in getitem(). I have also experimented with other tio augmentation methods and they have all failed with

"call takes two positional arguments but four were given"

MECLabTUDA commented 4 months ago

Hi SouLeo,

I'm sorry for not getting back to you sooner.

To your question on the OOD Augmentation: Thanks for noticing this error in the brats.py. This was a transfer error as I wanted to condense everything into one dataset for the git. I created a dataset version for each artifact and saved them to the hard drive: Motion Ghosting Noise and Spikes. I also experimented with the Bias field, but it did not impact performance as much, so we left it out. Correct was using the RandomNoise (https://torchio.readthedocs.io/transforms/augmentation.html#randomnoise) and not RandomBiasField.

self.Aug = tio.OneOf({RandomNoise(mean=(0.2,0.5),std=(0.2,0.5)): 1.0}, p=1.0,)
self.Aug = tio.OneOf({RandomSpike((1,3),(1,3)): 1.0}, p=1.0,)
self.Aug = tio.OneOf({RandomGhosting(num_ghosts=(1,10)): 1.0}, p=1.0,)
self.Aug = tio.OneOf({RandomMotion(degrees=25, translation=15)): 1.0}, p=1.0,)

Then you need to use the torchio pipeline and build a subjectdataset to forward it through. This was slow, so I saved it to the hard drive and loaded it as the usual ID images.