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

Unable to read Primary Fluence Mode Sequence #85

Open
Malorh opened this issue Jan 5, 2021 · 0 comments
Open

Unable to read Primary Fluence Mode Sequence #85

Malorh opened this issue Jan 5, 2021 · 0 comments

Comments

@Malorh
Copy link

Malorh commented Jan 5, 2021

I need to look up if a treatment beam is a flattening filter free beam. This information is stored in the "primary fluence mode sequence" (tag 3285,1000) (see ftp://medical.nema.org/medical/dicom/final/cp805_ft.pdf when this was added to DICOM in 2008).
However, EvilDICOM (v. 2.0.6.5; the most recent version) has all the following variables empty (tested using the DICOMObject and DICOMSelector):
PrimaryFluenceModeSequence_
FluenceModeID_
(and the variables without the underscore are unsurprisingly null, since they point to the first element in the lists).

Very notably, the DICOMObject can detect the tag (3285,1000) as unknown. It is registered under items in BeamSequence (300A,00B0).

I have tested this using DICOM RT plan files from two different institutions. Therefore, I think it less likely that I'm using a corrupt file.
Third party software "DicomEdit" can detect the dicom tag and data like any other tag. It shows the following subitems (VR = value representation) with example values for my file

Tag VR Description Value
(3285,0010) LO Varian Medical Systems VISION 3285 Varian Medical Systems VISION 3285
(3285,1001) CS Fluence Mode NON_STANDARD
(3285,1002) SH Fluence Mode ID FFF

Note that the Fluence Mode ID only exists if the Fluence mode is NON_STANDARD (see the link above to the DICOM source) (though I don't know why it specifies (3002,0051) as the tag number for Fluence Mode).

Should other people come across the issue for their research before an update is released, know that you can parse the hex data to string and then scan the string to see if it contains the desired data (e.g. STANDARD, NON_STANDARD, FFF). Although this is obviously suboptimal, it is better than nothing. Example code:

DICOMObject dcm = DICOMObject.Read(file); // "file" is a string with value as the path to my file (RP*.dcm)
var primaryFluenceModeSequence = dcm.FindAll("32851000");
// @other people reading this on github; remember to here check if the sequence exist and handle accordingly. For my needs, this is "if (primaryFluenceModeSequence.Count == 0) return false;" here, though yours may differ, obviously.
int nFluenceBytes = primaryFluenceModeSequence[iBeam].DData_.Count;
byte[] fluenceBytes = new byte[nFluenceBytes];
for (int iByte = 0; iByte < nFluenceBytes; iByte++)
{
	fluenceBytes[iByte] = (byte)primaryFluenceModeSequence[iBeam].DData_[iByte];
}
string fluenceAsString = System.Text.Encoding.ASCII.GetString(fluenceBytes);
bool isFffBeam;
if (fluenceAsString.Contains("NON_STANDARD") && fluenceAsString.Contains("FFF")) isFffBeam = true;
else isFffBeam = false;

PS: Thanks a lot for EvilDICOM. It has saved me a lot of time!

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