-
Notifications
You must be signed in to change notification settings - Fork 98
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
Private tags after anonymization #51
Comments
It has nothing to do with anonymization. It has to do with the format used for writing the DICOM file to bytes. If you use EXPLICIT VR in your DICOM settings, it will write the VR. Otherwise, it just writes the tag, and on reading back, if the tag is not in the Evil DICOM dictionary, it won't know which kind of VR it is. Here is a test that shows you what I mean: var dcm = new DICOMObject();
dcm.Add(new LongString(new Tag("32751000"), "Online3D"));
var dcmBytes = new byte[0]; //Start empty
using (var ms = new MemoryStream())
{
using (var dw = new DICOMBinaryWriter(ms))
{
//Explicity
DICOMObjectWriter.Write(dw, DICOMIOSettings.DefaultExplicit(), dcm);
}
dcmBytes = ms.ToArray(); //Store to read back
}
var dcmBack = DICOMObject.Read(dcmBytes);
//This passes
Assert.IsTrue(dcmBack.FindFirst("32751000").VR == EvilDICOM.Core.Enums.VR.LongString);
using (var ms = new MemoryStream())
{
using (var dw = new DICOMBinaryWriter(ms))
{
//Implicit
DICOMObjectWriter.Write(dw, DICOMIOSettings.Default(), dcm);
}
dcmBytes = ms.ToArray(); //Store to read back
}
dcmBack = DICOMObject.Read(dcmBytes);
//This fails
Assert.IsTrue(dcmBack.FindFirst("32751000").VR == EvilDICOM.Core.Enums.VR.LongString); |
HiMany thanks, I thought it was something l had missed.Thank you for your time.James
On Thursday, 1 February 2018, 23:04, Rex Cardan <notifications@github.com> wrote:
It has nothing to do with anonymization. It has to do with the format used for writing the DICOM file to bytes. If you use EXPLICIT VR in your DICOM settings, it will write the VR. Otherwise, it just writes the tag, and on reading back, if the tag is not in the Evil DICOM dictionary, it won't know which kind of VR it is. Here is a test that shows you what I mean:` var dcm = new DICOMObject();
dcm.Add(new LongString(new Tag("32751000"), "Online3D")); var dcmBytes = new byte[0]; //Start empty
using (var ms = new MemoryStream())
{
using (var dw = new DICOMBinaryWriter(ms))
{
//Explicity
DICOMObjectWriter.Write(dw, DICOMIOSettings.DefaultExplicit(), dcm);
}
dcmBytes = ms.ToArray(); //Store to read back
}
var dcmBack = DICOMObject.Read(dcmBytes);
//This passes
Assert.IsTrue(dcmBack.FindFirst("32751000").VR == EvilDICOM.Core.Enums.VR.LongString);
using (var ms = new MemoryStream())
{
using (var dw = new DICOMBinaryWriter(ms))
{
//Implicit
DICOMObjectWriter.Write(dw, DICOMIOSettings.Default(), dcm);
}
dcmBytes = ms.ToArray(); //Store to read back
}
dcmBack = DICOMObject.Read(dcmBytes);
//This fails
Assert.IsTrue(dcmBack.FindFirst("32751000").VR == EvilDICOM.Core.Enums.VR.LongString);`
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a DICOM dataset that I wish to anonymize which I do using the anonymization queue. I have a possible problem with the DICOM RT REG files where a private tag is changed (remove private tags settings false). The original is (3275,1000), VR=LO and value 'Online3D' but when passed through the anonymization queue (3275,1000), VR=unknown and value appears to be Online3d as an ascii array.
I am using the current version.
Any Ideas
The text was updated successfully, but these errors were encountered: