chinmay5 / vit_ae_plus_plus

Code base for the paper ViT-AE++: Improving Vision Transformer Autoencoder for Self-supervised Medical Image Representations
Creative Commons Zero v1.0 Universal
40 stars 4 forks source link

BRATS dataset version and processing #3

Open JSGrondin opened 1 year ago

JSGrondin commented 1 year ago

Hi, Thanks a lot for your paper and for sharing your implementation. I would like to confirm what version of the BRATS dataset did you use? Was it the 2018 version and only the Training set, or did you use another version? Also, from looking at the naming of the brats directory that you used ('brats_processed'), I understand that some processing was used as a preliminary step. I was wondering if you could give more details on this, if not provide the preprocessing steps in the codebase as well?

chinmay5 commented 1 year ago

We performed skull-stripping and alignment to the MNI space. Finally, we take a crop of 96 x 96 x 96 as the input. Perhaps, @hongweilibran can shed some light. We will try to upload the preprocessing script by next week.

JSGrondin commented 1 year ago

@chinmay5 , thanks for your answer! If that is not easy, a sample of the dataset and file structure would be great! I'm interested in testing your implementation of 3D ViT-AE++ on my 3D medical dataset but would need to know how to prepare my data in a format that is readily usable. I would have liked also to try to reproduce your results on BRATS first but if that is not easily doable, I'll go straight to using my dataset. Which version of BRATS did you use (what year, training only?), which source did you use for the download?

chinmay5 commented 1 year ago

Sorry for the late response. We will try to upload the script for processing the BraTS dataset asap. Yes, we only used the training split. We preprocess the individual scans to generate a 96 x 96 x 96 crop. We stack all the individual crops together into a large matrix of shape

num_samples, 96, 96, 96, num_modalities.

You can observe this line performs a transpose operation to ensure channel-first mode. The line should be commented out if you stack the array channel first.

joangog commented 9 months ago

@chinmay5 In brats_split.py you seem to be using only a file called flair_all.npy. Does that means that you only use flair images in your large matrix? Above you mentioned that you also have a dimension for the modalities for that matrix so I am a little confused. Where in brats_split.py are you using all the modalities to create the splits?

joangog commented 9 months ago

@chinmay5 Also, it seems like you load the .npy file whole into memory. I tried creating my own preprocessing script but unfortunately I run out of memory very fast because I tried to create the large matrix that you are suggesting. Did you do some kind of batch-processing? How did you deal with this issue?

chinmay5 commented 5 months ago

Hi, @joangog, Sorry for the late response. The code was uploaded after some ablations. So, the experiments are not only for the Flair channel. Please feel free to update the script. Regarding the preprocessing script, in case you run out of memory, please load the files at run time. The disk IO can slow things a bit but hopefully, not by a lot, especially if you can start with multiple threads. Let me know how it goes.

gaoqiong123 commented 5 months ago

could you tell me what the flair_all.npy、feature_flair.npy and label_all.npy is? and how can I get them ? which process code was used? thank you