SlicerDMRI / SupWMA

[MedIA 2023] "Superficial White Matter Analysis: An Efficient Point-cloud-based Deep Learning Framework with Supervised Contrastive Learning for Consistent Tractography Parcellation across Populations and dMRI Acquisitions", Medical Image Analysis
https://supwma.github.io
Other
22 stars 5 forks source link

Help on how to train on custom public dataset! #5

Closed anoushkrit closed 1 year ago

anoushkrit commented 2 years ago
image

This is a snapshot of a subject from dHCP dataset, and I want to try out the SupWMA code on the same. I am finding difficulty in understanding how the data is passed through as a custom TrainDataset, from what I have gathered as of now is that I require a .nrrd and a .vtp file for starting the training process. But I have .bvec, .bval , brain data .nii.gz and the mask .nii.gz, how can I go forward with this, I have found some of the slicer implementations for conversion of data types, but I think that won't be enough. Also I think there is a requirement of sf_clusters_train_featMatrix.h5 like file for training the model. @tengfeixue-victor Can you please help me with the same and also provide the preprocessing script used by you?

PS: I am new to the neuroimaging field and would like increase my knowledge in the same.

zhangfanmark commented 2 years ago

Hi @anoushkrit

We used DWIConvert to convert the data from nifti format to nrrd format. The Nrrd format is what being used in SlicerDMRI to run tractography. You can used the following code to do the conversion: https://github.com/pnlbwh/conversion

Regards, Fan

anoushkrit commented 1 year ago

Thank you for the answer! The solution worked for us. We are currently trying to train the model on a public dataset which was mentioned in the paper DeepWMA, i.e dHCP dataset. So the issue we are facing is the error of No zero gradients, even after converting both input_dwi and mask to nrrd using nhdr_write.py. Please tell me what am I doing wrong here. I have specified --dwiFile, --labels 1, --maskFile, --numTensor 2, and the output tract path, is there anything else I need to add in this? The source of the data remains the same as above in the image (having bval, bvec, mask, dwi)

image