Comments (5)
The corresponding issue in dcmjs-dimse: #PantelisGeorgiadis/dcmjs-dimse/issues/40
from dcmjs.
What is the purpose of splitting PixelData into such small chunks by default?
Thanks for the careful debugging. it looks like there's a long history of commits related to this code, but the behavior seems to trace back to the original implementation, so there's no specific discussion of the original implementation, but it's probably for efficiency and memory management.
Since you have been able to isolate this issue do you see a solution?
from dcmjs.
I've also run into an issue in this area recently, and discovered that pydicom
with certain libraries loaded doesn't reliably handle multiple fragments per frame in multi-frame DICOMs. Opened an issue for it here: pydicom/pydicom#1774.
My understanding (which is not canonical) is that these fragments are supported in order to help split up very large pieces of compressed image/frame data, but exactly how this is meaningfully leveraged by implementations in practice I don't have direct experience of.
The relevant part of the spec is https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_A.4.html.
In my experience, the general level of support for multi-fragment storage of DICOM image data, particularly multiple fragments per frame in e.g. a multi-frame ultrasound, seems patchy. For this reason, not using it seems reasonable unless one has a strong reason to want it (and frankly I've yet to come across one, but am keen to understand what the use cases are).
Why dcmjs turns fragments on by default, and uses a fragment size of 20 KiB which does seem small, I simply don't know. I did some PRs a while back that fixed dcmjs' support for multi-fragment files so it was in alignment with the DICOM spec, but no doubt there are libraries/implementations around that don't follow the spec or implement all parts of it, so it may be best to just turn off multi-fragment altogether via writeOptions
.
I think I'd be in favour of making this the default in dcmjs, but in saying that I don't feel 100% confident that I understand the potential ramifications of doing that. Maybe in some cases with very large datasets it starts to matter, but also those people can always turn it on if they need it.
from dcmjs.
I don't have a lot of experience with this either, but I'm sure you are correct @richard-viney that various data or implementations will vary in their support and correctness.
I suspect this feature could come up in whole slide imaging use cases, e.g. in Slim.
At this point I'm wary of changing default behavior but if we have some example data and tests we could compare notes with other dicom developers and see what we think the most reasonable behavior should be.
from dcmjs.
For what it's worth, it looks like pydicom defaults to one fragment per frame:
from dcmjs.
Related Issues (20)
- move "eslint-config-prettier" to devDependencies
- Reading a big sized DICOM: RangeError: Offset is outside the bounds of the DataView HOT 4
- Encapsulated pixel data of odd-length writes padding byte in incorrect location HOT 2
- ReadBufferStream not support latine 1 on Mobile HOT 6
- Offset is outside the bounds of the DataView
- JS exception while saving report
- [Cornerstone adapters] Tool is undefined when saving FreehandRoi tool in structured report HOT 4
- Trouble doing basic loading HOT 5
- Changing instance UID corrupts file, Invalid DICOM file, expected header is missing HOT 5
- Support annotations on multi-frame files through Cornerstone3D HOT 1
- SR support with Cornerstone 3D - multi-frame DICOM files HOT 1
- Crash due to no TextEncoder on nodejs HOT 9
- NaN and Infinity number values cause write to fail HOT 4
- Reading malformed DICOM file causes infinite loop HOT 3
- [mutiple Qs]: convert .jpg to .dcm, no dicom header, could't not find declaration module ''dcmjs",... HOT 5
- DicomMessage.readFile failes if GroupLength parameter is wrong calculated HOT 4
- use SegmentNumber from the segment metadata exporting DICOM SEG. HOT 6
- anonymizer uses incorrect tag names HOT 1
- The saved image file is inconsistent with the source file. HOT 9
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 dcmjs.