MedLearn
MedLearn

Reputation: 31

How to preprocess NIfTI data format using NiBabel

after convertig a NIfTI-file to an array using NiBabel, the array has three dimensions and the numbers look like this:

[-9.35506855e-42 -1.78675141e-35  1.18329136e-30 -1.58892995e-24
5.25227377e-24  1.11677966e-23 -2.41237451e-24 -1.51333104e-25
6.79829196e-30 -9.84047188e-36  1.23314265e-43 -0.00000000e+00]

How can I preprocess this array for machine-learning? When choosing only the exponent, most of the information gets lost when plotting the image, so maybe the base is also important?

Upvotes: 1

Views: 1142

Answers (1)

divinediu
divinediu

Reputation: 433

This will help you to convert a niftiimage to access as numpy array:

img = nib.load(example_filename)
data = img.get_fdata()

Upvotes: 0

Related Questions