Comments (7)
Sample original and edited files
orj_editedlocal.dcm is the file created by using the code snippet given above
edited_by_epad.dcm is the file created by ePAD using a similar code to the code snippet given above
from dcmjs.
@pieper any ideas?
from dcmjs.
Hi @emelalkim thanks for your patience - I think the issue is that MediaStorageSOPInstanceUID
is only supposed to be in the part10 (dicom file) metaheader and not in the dataset itself.
In dcmjs that's stored in the _meta
field in the the javascript object, like in this code that parses a part10 from an array of bytes. Let me know if that approach solves the issue.
from dcmjs.
Hi @pieper, thank you for the feedback
I tried modifying the code as below but it doesn't edit the MediaStorageSOPInstanceUID now
const fs = require("fs");
const filePath = "/Users/ealkim/bra45-4510-413-ser/orj.dcm"
let arrayBuffer = fs.readFileSync(filePath).buffer;
let DicomDict = dcmjs.data.DicomMessage.readFile(arrayBuffer);
const dataset = dcmjs.data.DicomMetaDictionary.naturalizeDataset(DicomDict.dict);
dataset._meta = dcmjs.data.DicomMetaDictionary.namifyDataset(DicomDict.meta);
dataset.SeriesInstanceUID = '2.25.23542678765445654764635245765';
dataset.SOPInstanceUID = '2.25.23542678765445654764635245769';
dataset._meta.MediaStorageSOPInstanceUID = '2.25.23542678765445654764635245769';
DicomDict.dict = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(dataset);
let new_file_WriterBuffer = DicomDict.write();
fs.writeFileSync("/Users/ealkim/bra45-4510-413-ser/orj_editedlocal2.dcm", Buffer.from(new_file_WriterBuffer));
Am I doing it wrong?
And I think it is actually about the data itself. I mean '2.25.23542678765445654764635245769'. There is no issue with ones 1.3... something. I believe it should be valid DICOM UID. What do you think?
from dcmjs.
Hmm, either 2.25.xxx or 1.3.xxx should be fine. There are rules in the standard about what's allowed in these strings of numbers but software like dcmjs shouldn't care. (We use the 2.25 form since it's considered to be the correct way to prefix a random number, while the 1.xxx forms are related to registered prefixes).
In addition to
DicomDict.dict = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(dataset);
Maybe you need to add
DicomDict.meta = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(dataset._meta);
?
If it's still a problem the code to write the data shouldn't be too hard to trace through.
from dcmjs.
Related Issues (20)
- The saved image file is inconsistent with the source file. HOT 9
- private Tags take element wrong into account HOT 1
- Segmentation loading with wadors not working HOT 2
- dcmjs-imaging HOT 2
- Invalid tag in sequence : Unable to parse MR Dicom file in dcmjs. Cornerstone able to parse and works fine HOT 1
- Length of Decimal String larger than 16 characters
- Lots of 'Invalid vr type... ' log messages in dcmjs release 0.29.11 HOT 4
- modifying dicom meta-data HOT 2
- Reading dicom file HOT 2
- Getting ERROR: Value exceeds max length for some DICOM tags HOT 2
- Write issue for JPEG2000Loseless images HOT 3
- Issue with pixel redaction for JPEGLoseless type HOT 1
- Change in PixelSequence value HOT 1
- Support for reading from a readable stream HOT 1
- Test failing due to missing image referenced by seg HOT 1
- PN tags interpretation as union between object and string breaks DIMSE functionality HOT 2
- Can use to load dicom segment? HOT 1
- Fail to denaturalize a sequence having private tags. HOT 1
- Netlify-deployed docs site (https://dcmjs.netlify.com/) is down 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 dcmjs.