Comments (6)
Actually it looks like any of the string based VRs would have the same issue.
from evil-dicom.
I just made a unit test to do check this problem. It doesn't fail. I'm using the most recent Git repo (check the prerelease box in NuGet if thats what you are using to get the most up to date...don't know about v 2.0.0):
[TestClass]
public class CodeStringMultiplicityTests
{
[TestMethod]
public void CanAddMultipleStringsTest()
{
var dcm = new DICOMObject();
dcm.ReplaceOrAdd(DICOMForge.ImageType("Type1", "Type2", "Type3"));
var expected = 3;
var data = dcm.GetSelector().ImageType.Data_;
var actual = data.Count;
Assert.AreEqual(expected, actual);
Assert.AreEqual("Type1", data[0]);
Assert.AreEqual("Type2", data[1]);
Assert.AreEqual("Type3", data[2]);
}
}
from evil-dicom.
from evil-dicom.
Interesting. I see the problem in the datacomposer class as well. I will patch today and update this thread when complete.
from evil-dicom.
from evil-dicom.
Well it is a little weird. I see why I made it like that. The DICOM standard is not really clear how those CodeString can have multiple values. But I did see the ImageType VM > 1 so I put it in. Not all string values can have multiple values (eg. LongText, ShortText, UniversalResourceId). Anyway, I did a first pass with it and I think it should work for you (NuGet v 2.0.0.5). Here is my new test.
[TestMethod]
public void CanAddMultipleStringsTest()
{
var dcm = new DICOMObject();
dcm.ReplaceOrAdd(DICOMForge.ImageType("Type1", "Type2", "Type3"));
//Memory test
var expected = 3;
var data = dcm.GetSelector().ImageType.Data_;
var actual = data.Count;
Assert.AreEqual(expected, actual);
Assert.AreEqual("Type1", data[0]);
Assert.AreEqual("Type2", data[1]);
Assert.AreEqual("Type3", data[2]);
var bytes = new byte[0];
//Test IO
using (var ms = new MemoryStream())
{
//WRITE
using (var bw = new DICOMBinaryWriter(ms))
{
DICOMObjectWriter.Write(bw, DICOMWriteSettings.Default(), dcm);
}
bytes = ms.ToArray();
}
//READ
var dcmRead = DICOMObject.Read(bytes);
expected = 3;
data = dcmRead.GetSelector().ImageType.Data_;
actual = data.Count;
Assert.AreEqual(expected, actual);
Assert.AreEqual("Type1", data[0]);
Assert.AreEqual("Type2", data[1]);
Assert.AreEqual("Type3", data[2]);
}
from evil-dicom.
Related Issues (20)
- Feature Request: Single Association Mass CStore request
- Feature Request: Get (300A,000C) RTPlanGeometry Dicom tag HOT 1
- DICOM to BEV Transformation
- SendCStore skips important RS-DICOM-Tag (0008,0106) for Eclipse-Import
- Dicom File Larger than 2 GB HOT 7
- DICOMSCP error when a contour has many points HOT 1
- A typo in method bool IsInBounds(Vector3 pt) in RT package
- Anonymization fails for RP-files HOT 1
- Possible leak in DICOMSCU HOT 2
- MaskImageFast Error
- Unable to read Primary Fluence Mode Sequence
- CMove from ARIA to Self - CT Images (EvilDICOM v2.0.6.5) HOT 2
- ReadIndefiniteBigEndian uses LittleEndian for EndOfSequenceItem
- Queue.Anonymize() throws System.InvalidOoperationException HOT 2
- Progress and Roadmap of Evil-DICOM
- Meta/Header information not being written
- Unable to retrieve tag BeamDeliveryDurationLimit (300A,005C) HOT 1
- Is there any tool for writing Dicom-RT structure easily?
- How to delete one structure from loaded DICOM StructureSet
- RTDose CStore error when sending to MIM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evil-dicom.