eitcom / pyEIT

Python based toolkit for Electrical Impedance Tomography
Other
177 stars 100 forks source link

Open .EIT files #10

Closed jannisborn closed 2 years ago

jannisborn commented 4 years ago

Sorry for the potentially dumb question:

I'm new to EIT but got access to lung EIT data from COVID patients, saved in .eit format. I would like to visualize the data and visually inspect it. I installed the package, but I'm lost on how to start. Do you have any standalone documenation website (e.g. made with Sphinx and hosted with github pages)? Basically, I'm just searching for a way to open .eit files on Mac OS.

Thanks a lot!

liubenyuan commented 4 years ago

what's the file format definitions of the .eit file?

There is a simple document on how pyeit parses the data, https://github.com/liubenyuan/pyEIT/blob/master/doc/pyEIT-data_format.pdf

You should write a wrapper in pyeit/io to parse the .eit data in any of the format that pyeit supports.

liubenyuan commented 4 years ago

Sorry for the potentially dumb question:

I'm new to EIT but got access to lung EIT data from COVID patients, saved in .eit format. I would like to visualize the data and visually inspect it. I installed the package, but I'm lost on how to start. Do you have any standalone documenation website (e.g. made with Sphinx and hosted with github pages)? Basically, I'm just searching for a way to open .eit files on Mac OS.

Thanks a lot!

I can help you with the file format conversion if the data format of .eit is available.

jannisborn commented 4 years ago

Thanks for the pointers @liubenyuan! Unfortunately, I don't think I'm capable of writing a converter since I never worked with EIT data before.

The software I was given for processing the files is from here: https://draeger-msi.de/en/services_en/downloads/.

It would be great if you're willing to help, I can send you an example file I have. Or would the recommended guideline to use a Windows machine with the mentioned software for analysis?

liubenyuan commented 4 years ago

The wrapper would be best written with a detailed manual on the .eit binary file format.

I can write a .eit parser for you, using the information already exists in the EIDORS package: http://eidors3d.sourceforge.net/doc/index.html?eidors/interface/eidors_readdata.html Though, I need a sample .eit data, as well as the images at two different time stamps, for example, an EIT image at frame 100 with the reference frame data set to the 0th frame, so that I could check whether the file parser I wrote is correct.

jannisborn commented 4 years ago

Thanks a lot @liubenyuan, that would be great. I should be able to share an example file with you. I'll contact you directly.

kelades commented 3 years ago

Hi, I have the exact same problem with @jannisborn. Would it be possible to share some information about the parser? Thanks for any help!

liubenyuan commented 3 years ago

@kelades I haven't EIT file format definition (nor an .EIT file) at hand. I would like to help extending pyeit with .EIT extension if this information are available.

liubenyuan commented 3 years ago

@jannisborn @kelades Here are two MATLAB scripts in parsing .eit file format https://github.com/ybk2810/EIT_ImageProcessing/blob/master/EIT/ST_EIT_reader.m https://github.com/EIT-team/Load_data/blob/master/src/matlab/SwissTom_EIT_reader.m

And here is a sample .eit file, https://github.com/EIT-team/Load_data/blob/master/resources/data/SwissTom/r-phantom.eit

Is this the eit file format you are using?

Currently, Draeger (Pulmovista) "EIT" file format (2008+) are most widely used. If this is the file format you are using, may be we need to recreate the functions in EIDORS eidors_readdata: http://eidors3d.sourceforge.net/doc/index.html?eidors/interface/eidors_readdata.html

kelades commented 3 years ago

Thank you for your reply. Yes this is the format I have my data in. Currently, I am trying to run the matlab scripts (the ones you already mentioned) to parse them - but I am still looking for a solution in Python.
As I understood from what's been said, there isn't a parser to read data from a .eit file format and I would need to write it on my own , right? If I can find some time, I would like to give it a try - do you have some guidelines you can share, as I am not familiar with this kind of data and I don't know where to start ?

liubenyuan commented 3 years ago

Are your data swisstom AG format or Daeger (pulmovista) format? Yes, you need a parser in pyeit, I can write for you given there is a sample data (i.e., a .eit file collected using your device). I can port the code in EIDORS in pyeit. A sample reconstructed image is also helpful for me to validate the parser.

kelades commented 3 years ago

That would be extremely helpful. Unfortunately I don't have a reconstructed image for validation ( that 's one of my goals. parse the data and then produce the reconstructed images). Would you like me to upload a sample file here?

liubenyuan commented 3 years ago

Sure, I can use the sample file for validation.

kelades commented 3 years ago

This is the data file (github doesn't support .eit so I put them in a zip) data.zip

liubenyuan commented 3 years ago

a b c d

@kelades

Is this the result you expected? The EIT image is the time difference between 34 (now) and 10 (reference), and 25 (now) to 10. Note that the mesh does not match a throax shape, and the orientation and locations of electrodes may not be the way you are using. You should use your own mesh, and electrodes locations.

If it is ok, I will clean up the codes and create a PR so you can use it. BTW, is it ok that I upload a slice of this data (60 frames) on pyeit/app and refer to this issue?

kelades commented 3 years ago

yes I think that would be it. Ok, noted for the meshes. Yes , ok about the slice of data. Thank you very much for your help, much appreciated

liubenyuan commented 3 years ago

@kelades I update pyeit and the reproducible code using a slice of your data are put into https://github.com/liubenyuan/pyeit-apps/tree/master/daeger I am glad to help if you encounter any problem in using pyeit.

Thank you for your data and you are welcome to pull some PRs for pyeit or pyeit-apps