tym002 / landmark_detection

6 stars 0 forks source link

How to generate proper data for training? #2

Open hanhanminnan opened 2 years ago

hanhanminnan commented 2 years ago

To begin with, thank you for sharing your code! I mention that the file format needed for training is npy files. It is confusing for me how to convert my MRI data(a nii file) into a proper npy file.

tym002 commented 2 years ago

Hi, I usually use NiBabel for loading and converting .nii files Here is their website: [https://nipy.org/nibabel/gettingstarted.html] You can do something like this:

example_filename = os.path.join(data_path, 'example4d.nii.gz')
img = nib.load(example_filename)

Please let me know if you have other questions