user2023098
user2023098

Reputation: 11

How to get the value with VR=FL, VM=2 in Evil DICOM

I tried to get the Tag value by using: var vSAD = sel.VirtualSourceAxisDistance.Data; I also tried var vSAD = dcm.FindAll("300A030A"); And it only returned one number (suppose to have 2).

Then I tried to read elements and save to another dicom file only and found for VR=FL, VM=2 case only one number showed up in the new file. How can I fix this to get 2 numbers? Does it mean when I use var dcm = DICOMFileReader.Read(openFileDialog1.FileName); It already return with only one number?

I saw in the FloatingPiontSingle.cs file:

public class FloatingPointSingle : AbstractElement<float?>
{
    public FloatingPointSingle() { }

    public FloatingPointSingle(Tag tag, float? data)
    {
        Tag = tag;
        Data = data;
        VR = Enums.VR.FloatingPointSingle;
    }
}

Upvotes: 0

Views: 593

Answers (1)

RexCardan
RexCardan

Reputation: 438

I didn't realize the FL VM could be more than one. I just looked at the DICOM specification though and realize that it is possible. It is actually an easy fix. Could you post a link to a sample (anonymized) DICOM file that contains such a value and I will patch the core framework.

FYI: To patch yourself, you would need to change the FloatingPointSingle to:

public class FloatingPointSingle : AbstractElement<float[]>
{
    public FloatingPointSingle() { }

    public FloatingPointSingle(Tag tag, float[] data)
    {    
        Tag = tag;
        Data = data;
        VR = Enums.VR.FloatingPointSingle;
    }
}

Then in the LittleEndianReader.ReadSinglePrecision(), and BigEndianReader.ReadSinglePrecision() method you will need to change out the logic to allow concatenated floating point numbers (no delimiter).

Upvotes: 2

Related Questions