Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open MPI data in python code #11

Open
obaida90 opened this issue Oct 21, 2023 · 18 comments
Open

Open MPI data in python code #11

obaida90 opened this issue Oct 21, 2023 · 18 comments

Comments

@obaida90
Copy link

I'm new in the field of MPI. I want to open the Open MPI data using the python code for the system matrix (SM) reconstruction given in the website. My issue is how I can choose the SM and measurement pairs to run the code.

@hofmannmartin
Copy link
Member

Suitable pairs must be measured with the matching excitation sequence and tracer. Information about both can be found here for all datasets.

As a side note, I would advise you to start with datasets measured with a 2D Lissajous excitation, since the corresponding system matrices are much smaller than for a 3D Lissajous excitation.

@obaida90
Copy link
Author

Thank you for reply
I would like to open the data for example the first 1D system matrix with the 1D concentration phantom measurement in Jupyter notebook, although they have the same tracer and sequence but there was an error sayed "cannot reshape array of size 112632000 into shape (2,1083000)" ?

@hofmannmartin
Copy link
Member

There are numerous challenges associated with using MPI data, and your question is a bit vague. Can you please provide a code sample to illustrate your problem?

@obaida90
Copy link
Author

Yes offcourse, the code is here: https://github.com/MagneticParticleImaging/MDF/tree/master/python ; what I did is I combined the three codes in this link together (KaczmarzReg.py, pseudoinverse.py and reco.py).

@hofmannmartin
Copy link
Member

Could you narrow down, in which file and at line the Error occurs?

@obaida90
Copy link
Author

Ok in fact I faced several errors but the most common one is in these lines :
1)# merge frequency and receive channel dimensions
S = reshape(S, (shape(S)[0]*shape(S)[1],shape(S)[2]))
u = reshape(u, (shape(u)[0],shape(u)[1]*shape(u)[2]))

  1. reconstruct using signular value decomposition

U, Sigm, V = svd(S, full_matrices=False)
csvd = pseudoinverse(U, Sigm, V, u, 5e2, True, True)

@chuyuenin
Copy link

I found the OpenMPI data set link at https://media.tuhh.de/ibi/openMPIData/data/, but the system matrix and the measured signal must match each other to reconstruct the image, but these two folders (one system matrix folder, the other is the folder for the measured signals) I don't know which system matrix matches which measurement data. I mainly want 2D data

@tknopp
Copy link
Member

tknopp commented Jul 5, 2024

just look here: https://magneticparticleimaging.github.io/OpenMPIData.jl/latest/datasets.html
you need to match tracer and sequence. then they will be compatible.

@chuyuenin
Copy link

Thank you for your reply. I browsed the URL you provided (https://magneticparticleimaging.github.io/OpenMPIData.jl/latest/datasets.html) and found the 2D system matrix data as shown in Figure 1, but I found it in your The OpenMPIData dataset (https://media.tuhh.de/ibi/openMPIData/data/calibrations/) found a lot of system matrix files, as shown in Figure 2, can you tell me which one is the 2D system matrix?
Snipaste_2024-07-06_14-58-03
Snipaste_2024-07-06_14-59-24

@mgraeser
Copy link

mgraeser commented Jul 6, 2024

You can use all 2D Lissajous system matrices, so calibrations number 2.mdf and 5.mdf in the table sent by Tobias. Any experiment with number 2.mdf (2D Lissajous) will be compatible.

@sesafe
Copy link

sesafe commented Jul 6, 2024

I am very interested in your paper titled "3d-SMRnet: Achieving a new quality of MPI system matrix recovery by deep learning", but when I want to run the code you provided, I found that the data set link you provided is invalid. . Can you provide a link to the dataset?

@mgraeser
Copy link

mgraeser commented Jul 6, 2024 via email

@chuyuenin
Copy link

Hello, can you help me explain (https://media.tuhh.de/ibi/openMPIData/data/calibrations/) the files 7.mdf to 17.mdf in the URL are the system matrices of several dimensions. And which are the high-resolution system matrices and which are the corresponding third-resolution system matrices, as shown in the figure.
3

@sesafe
Copy link

sesafe commented Aug 1, 2024

Under Datasets https://magneticparticleimaging.github.io/OpenMPIData.jl/latest/datasets.htmlYou should find every information regarding grid and FOV size. Or do you mean the dimensions of the matrices in the MDF. If so please have a look at the MPI Data Format Paper MDF: Magnetic Particle Imaging Data Format https://arxiv.org/abs/1602.06072

Hello! When I reproduced the code provided in the paper "3d-SMRnet: Achieving a new quality of MPI system matrix recovery by deep learning" on github, I found that there was a problem with the data set link and could not be jumped. Then the dataset address you provided is a .mdf file, but the code requires a .h5 file. Could you please provide the data set of the original code? Thank you.

@chuyuenin
Copy link

Hello, may I ask (https://media.tuhh.de/ibi/openMPIData/data/) that the OpenMP data under this link has two folders: system matrix and voltage signal. Please tell me which 3D system matrix and voltage signal match each other to achieve imaging.

@Tzortzinaprk
Copy link

Hello, I’m new in programming and I’m trying to run the code you provide in Python for different SystemMatrix and measurements and it does not run. The program only works for these two files, which are provided in the code:
'http://media.tuhh.de/ibi/mdfv2/systemMatrix_V2.mdf'
'http://media.tuhh.de/ibi/mdfv2/measurement_V2.mdf'
For other pair of files one of the matrixes that is generated has different shape and the code stops working. I match the correct tracer and sequence. How can I overcome this problem? Thank you in advance!

@obaida90
Copy link
Author

obaida90 commented Nov 20, 2024 via email

@Tzortzinaprk
Copy link

Thank you for your reply!
I used the files you suggested and after a few adjustments I was able to run the code and have the expected results. I also tried to run the code for the same tracer-sequence for 1D and 2D files, but the code does not work. I used the 2.mdf systemMatrix and the 2.mdf from the resolution measurements. The problem in the code can be seen below.
PS: The number in bold in the IndexError changes every time I run the code
"IndexError: index 255 is out of bounds for axis 0 with size 0"

Screenshot 2024-11-27 162517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants