Fastmri installation

I'm trying to run the code included in fastmri, however, when I try to import fastmri, python told me that there is no module named fastmri.

I have already run python install, and the final output of my cmd is

Using d:\anaconda3\envs\chtorch\lib\site-packages
Finished processing dependencies for fastmri==0.1

And I run pip install fastmri, all output start with requirement already satisfied, I list one below:

Requirement already satisfied: zipp>=0.5 in d:\anaconda3\envs\chtorch\lib\site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard!=2.5.0,>=2.2.0->pytorch_lightning->fastmri) (3.5.0)

then I run pip install -e under the folder .\fastMRI, which is one instructions of the README under the same folder. However, it says that:

-e option requires 1 argument

How can I import fastmri correctlly?

Thank in advanced! Nayee

For the first case, I’m wondering if there’s a mismatch between your pip and your python. This can happen when using conda.

For the second, you need to run pip install -e .. You forgot the ..

I did find one bug and that is that we don’t require the packaging package.

Thanks for your reply!
It seems the missing . is the point, I now can import fastmri successfully.

I look into the multicoil dataset of brain,

file_name = 'data/multicoil_test/file_brain_AXFLAIR_200_6002441.h5'
hf = h5py.File(file_name)
volume_kspace = hf['kspace'][:]

find that the shape of kspace is

(16, 20, 640, 320)

according to the tutorial, they are number of slices, number of coils, height, width, respectively.
However, the following code do something like:

slice_kspace = volume_kspace[20]

it seems like the 0-dimension of volume_kspace don’t have the length, even the max length of 1-deminsion is 19. So I wonder if there is something wrong or maybe I miss any information here to understand that.
BTW, do you have the running result of this jupyter notebook, what I mean is the figures ploted in the notebook, because the figures seems a little strange to me, and I have no idea whether I plot the right images.
I used

slice_kspace_ = volume_kspace[:, 19, :, :]

and get the following result:

It seems like that the slice_image_rss are not a full image, I don’t know where is wrong.
If you can post your result in the github, may help more people.
Looking for your reply, and thanks again.

Hello @NayeeC, I think the tutorial was written for the knee data.

Hi @mmuckley, I tried the knee data, but the result from the RSS, which was supposed to be the full image, seemed to have the same resolution as the result from the undersample one. Maybe you can help me figure out why this situation happened.

Hello @NayeeC, could you post an issue on the GitHub repository? It gets a little more traffic and is better-handled by search engines.