HOW TO USE RIRE TO SHORTCUT DICOM INFO

2 views (last 30 days)
Hi all, anyone have experienced use RIRE?
fixedHeader = helperReadHeaderRIRE('rirePatient007MRT1.header');
movingHeader = helperReadHeaderRIRE('rirePatient007CT.header');
fixedVolume = multibandread('rirePatient007MRT1.bin',...
[fixedHeader.Rows, fixedHeader.Columns, fixedHeader.Slices],...
'int16=>single', 0, 'bsq', 'ieee-be' );
movingVolume = multibandread('rirePatient007CT.bin',...
[movingHeader.Rows, movingHeader.Columns, movingHeader.Slices],...
'int16=>single', 0, 'bsq', 'ieee-be' );
  4 Comments
mohd akmal masud
mohd akmal masud on 8 Feb 2021
Hi Asvin Kumar, let say my image dicom is 128ASTITR2SUB8.dcm,
so i wrote fixedHeader = helperReadHeaderRIRE('128ASTITR2SUB8.dcm.header');
but there is no info in my struct. as picture
should be, when i wrote fixedHeader = helperReadHeaderRIRE('rirePatient007MRT1.header');, the struct have 6 fields.
so, any ways to change my dicom data to 128ASTITR2SUB8.dcm to 128ASTITR2SUB8.header. so that i can extract the struct with 6 fields.
Walter Roberson
Walter Roberson on 8 Feb 2021
.dcm files do not have separate header files. ,dcm files are unified binary files with structured binary segments. https://docs.fileformat.com/image/dcm/

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 8 Feb 2021
.dcm files do not have separate header files. ,dcm files are unified binary files with structured binary segments. https://docs.fileformat.com/image/dcm/
It is possible to analyze a DICOM file to figure out where the image data is located. The easiest way to do that is to use dicominfo(), second easiest is to find an external DICOM C or C++ library and call upon it to extract the header info; the third way is to spend a whole bunch of time reading about the internals of DICOM file format and write code that can do the task for you.
However, image data in DICOM is not necessarily stored in uncompressed form that is compatible with multiband read. Each block of DICOM data has an associated header indicating the "Transfer Syntax" (TS) for the block of data (DICOM files can contain multiple blocks of data, and each block can have a different TS.) The TS field indicates which standard was used to store the data: DICOM programs read the block of data as binary and then pass it to the appropriate algorithm to decode into actual image data. Basic uncompressed blocks of interleaved uint8 or int16 or single precision or double precision are all supported, so it might be possible to use multibandread for particular DICOM images, but there are other supported algorithms too, including various compression algorithms (anywhere from Run Length Encoding on up to JPEG2000.)
In my opinion, you are going about this the wrong way: the helperReadHeaderRIRE and multibandread() calls are just one way to get data for the purpose of registering mulitmodal 3D images, and you should use any way that is suitable for your data, such as dicomread() . Do not waste your time trying to shoehorn your .dcm files into a form compatible with using RIRE and multibandread()

Asvin Kumar
Asvin Kumar on 8 Feb 2021
From what I gather, the RIRE format contains header and data files as mentioned here: https://www.insight-journal.org/rire/data_format.php. The 'Header File' section also mentions this: We have altered the standard by adding the number of slices to the “Image Presentation Information” group (see below) so that the format can accommodate the third dimension of our volume images.The headers that you see from RIRE project are a little different from associated DICOM info in a dcm file. I'm not aware of any approach that can create a RIRE header file for a given DCM file.
To see the header file from the example you mentioned, try
open rirePatient007MRT1.header
I can suggest part of the solution. As a first step, you can see the associated info with any dicom file by using the dicominfo function. The 'Rows' and 'Columns' properties from the header file correspond with 'Rows' and 'Columns' info from the DICOM Info metadata. You might have to handcraft other information. In this case, the 'NumberOfFrames' property from the DICOM Info metdata might be equivalent to the 'Slices' property from the header. More details on the 'NumberOfFrames' property are given here http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.6.html#sect_C.7.6.6.1.1.
Fair disclosure, I do not have an extensive background with DICOM. My answer is based on some of the MW Docs and a couple other authoritative pages. Walter seems to have more experience and can correct me if I'm wrong.
  1 Comment
Walter Roberson
Walter Roberson on 8 Feb 2021
NumberOfFrames is useful, but you need to specifically test the output from dicominfo() to find out whether it exists for your .dcm file: it is only meaningful for multi-frame modalities, and in DICOM, headers that are not meaningful for the modality of the stored data are usually omited. The expectation from the creators of the DICOM standard is that you will have queried which modality this particular DCM file is, and will only need the universal headers and the headers defined for that modality (plus optional private headers.)
The slightly ugly part for DICOM comes in figuring out what the slice thickness is; there are completely different headers for calculating that depending on the modality, even though the two ways effectively do the same thing. I have posted the code for extracting slice thickness information in the past.

Sign in to comment.

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!