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

Read data using ISMRMRD #1

Open
jcohenadad opened this issue Nov 15, 2024 · 0 comments
Open

Read data using ISMRMRD #1

jcohenadad opened this issue Nov 15, 2024 · 0 comments

Comments

@jcohenadad
Copy link
Member

jcohenadad commented Nov 15, 2024

Alternative tools to read pfiles:

ISMRMRD

The ISMRMRD (International Society for Magnetic Resonance in Medicine Raw Data) library cannot directly read GE P-files (P12345.7 or similar raw data files). However, you can use additional tools or scripts to convert the GE P-file into ISMRMRD's raw data format, which is .h5.


Steps to Work with P-files and ISMRMRD

To process P-files using ISMRMRD, you need to convert the P-file into ISMRMRD's .h5 format, as ISMRMRD is designed for a vendor-neutral raw data format.


1. Convert P-file to ISMRMRD Format

  • Using Available Tools:

    • There are converters like ge_to_ismrmrd (available in some ISMRMRD repositories or custom implementations) that can read GE P-files and write them into .h5 files compatible with ISMRMRD.
    • You may need the GE SDK (e.g., GERecon) or scripts developed by the research community to extract raw data and metadata from the P-file before conversion.
  • Custom Conversion:

    • If a suitable converter is unavailable, you can write a custom script:
      1. Use GERecon or other P-file parsers to extract k-space data and metadata.
      2. Save the extracted data into ISMRMRD's .h5 format using the ISMRMRD API.

2. ISMRMRD Workflow

Once the P-file is converted into an ISMRMRD-compatible .h5 file, you can use ISMRMRD libraries for reconstruction or processing:

Python Example with ISMRMRD:

import ismrmrd

# Open the converted ISMRMRD file
filename = "converted_file.h5"
dataset = ismrmrd.Dataset(filename, "dataset")

# Access header information
header = dataset.read_xml_header()
print(header)

# Read k-space data
for acqnum in range(dataset.number_of_acquisitions()):
    acq = dataset.read_acquisition(acqnum)
    print(acq.data)

3. Alternative Tools

  • If ISMRMRD isn't directly feasible, consider:
    • GERecon: GE-specific reconstruction software.
    • BART or custom reconstruction frameworks to handle raw k-space data extracted from P-files.
    • Third-party libraries like ismrmrd-python once you convert the file.

Challenges

  1. P-file Variants:
    • GE P-file structure may vary between scanner models or software versions. Parsing may require specific tools.
  2. Conversion Requirements:
    • Access to GE SDK or reverse-engineered tools may be necessary to extract raw data.
  3. Metadata Mapping:
    • Metadata in P-files might need to be reformatted to comply with ISMRMRD's conventions.

Let me know if you’d like help with specific conversion tools or writing a custom script!

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

1 participant