Comments (4)
I should add that this problem is not unique to VR. The same is true for SpecificCharacterSet. If it is not already part of the dataset, then it must be explicitly given when adding encoded strings. Of course, the difference is that if SpecificCharacterSet is not given then the default is ASCII (quite reasonable) while a default VR of UN for XS is perhaps unreasonable.
Perhaps XS should be an allowed VR in memory, but resolved to SS or US upon writing the file? This can also lead to complications because the value.AsInt() method needs to know the signed-ness of the stored value. So once again, it seems that the best option is to inform the user of the need to explicitly specify the VR.
from vtk-dicom.
Commit b54a3a1 (2005/3/2, v0.6.4) changes this issue: it ensures that calling the vtkDICOMValue constructor with vr=XS will create a value with vr=SS (unless explicitly created from "unsigned short *"), and it ensures that calling the constructor with vr=OX will create a value with vr=OW.
So, the current situation is as follows: When adding an attribute with dictionary type XS or OW to vtkDICOMMetaData, it will first try to resolve the VR by using e.g. PixelRepresentation or BitsAllocated, but if this is not possible, it will print a warning and the VR will default to SS or OW respectively.
Adding a value of dictionary type XS or OW to vtkDICOMItem will simply cause the value to not be added. This seems very bad, I think defaulting to SS or OW is better. Eventually a validator could check it and correct it, if just the sign of the VR is wrong, but if the attribute is missing outright then information is lost.
The list of (non-retired) elements with VR=XS or VR=OX is short:
ZeroVelocityPixelValue = 0x00189810, // XS M1 0
MappedPixelValue = 0x00221452, // XS M1 0
SmallestImagePixelValue = 0x00280106, // XS M1 0
LargestImagePixelValue = 0x00280107, // XS M1 0
SmallestPixelValueInSeries = 0x00280108, // XS M1 0
LargestPixelValueInSeries = 0x00280109, // XS M1 0
PixelPaddingValue = 0x00280120, // XS M1 0
PixelPaddingRangeLimit = 0x00280121, // XS M1 0
RedPaletteColorLookupTableDescriptor = 0x00281101, // XS M3 0
GreenPaletteColorLookupTableDescriptor = 0x00281102, // XS M3 0
BluePaletteColorLookupTableDescriptor = 0x00281103, // XS M3 0
LUTDescriptor = 0x00283002, // XS M3 0
RealWorldValueLastValueMapped = 0x00409211, // XS M1 0
RealWorldValueFirstValueMapped = 0x00409216, // XS M1 0
HistogramFirstBinValue = 0x00603004, // XS M1 0
HistogramLastBinValue = 0x00603006, // XS M1 0
ChannelMinimumValue = 0x54000110, // OX M1 0
ChannelMaximumValue = 0x54000112, // OX M1 0
WaveformPaddingValue = 0x5400100A, // OX M1 0
WaveformData = 0x54001010, // OX M1 0
OverlayData = 0x60003000, // OX M1 0
PixelData = 0x7FE00010, // OX M1 0
from vtk-dicom.
XS should default to US (not SS), because these tags come before PixelRepresentation (0028,0103) and will always be unsigned due to their use: ZeroVelocityPixelValue is for ultrasound, MappedPixelValue is for Opthalmic. Both IODs require PixelRepresentation to be 0, and both of these tags require the VR to be US if PixelRepresentation is 0.
ZeroVelocityPixelValue = 0x00189810, // XS M1 0
MappedPixelValue = 0x00221452, // XS M1 0
from vtk-dicom.
Commit 2cc9e0f does a reasonable job of fixing this. Now one vtkDICOMItem constructor can take a character set and the VR for XS as arguments, and another vtkDICOMItem constructor can take a vtkDICOMMetaData object from which it will deduce them.
Now the only time there should be a problem is when someone uses the default vtkDICOMItem constructor, or when there is otherwise not enough information to deduce the character set or VR for XS. In that case, the character set is assumed to be ISO_IR 6, and the VR for XS is assumed to be US.
from vtk-dicom.
Related Issues (20)
- Dealing with RescaleSlope in MRI HOT 1
- Zeros at end of file cause infinite loop HOT 1
- Tilted-gantry CT rectification requires SetMemoryRowOrderToFileNative() HOT 2
- BUILD date not included HOT 1
- vtkDICOMDirectory cannot find files in DICOM folder HOT 2
- Get metadata from vtkNIFTIReader HOT 3
- CMake minimum version update HOT 1
- Possible to have any python example? HOT 5
- Additional Query Attributes
- Vtk dicom
- dicomtonifti.exe fails when dicoms in series differ in bit depth HOT 4
- vtkDICOMParser cannot read DICOM files with non-ASCII characters in the filename HOT 7
- Bug in vtkDICOMReader.cxx at Line 2511 HOT 1
- Instrument directory search tools
- VS 2020 compile issue HOT 2
- Hello, can you update the latest version to vcpkg? HOT 1
- Could not find a package configuration file provided by "DICOM" with any of the following names HOT 3
- Compile error? HOT 1
- Reading multi-pass CT series HOT 3
- Localizers cause confusion with dicomtocsv output HOT 4
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 vtk-dicom.