I have an H.264 MPEG-4 format video file that I want to encapsulate as the pixel data in a dicom file I am creating. I have created an xml file describing the attributes, and am using the dcm4che3 xml2dcm tool to take the attrs and insert the video file as-is in the pixel data section.
However, the resulting dicom file will not load into any encapsulated mpeg-4 compliant viewer since, I suspect, I am not setting the offsets properly. Here is what I am using for loading the video file within the xml:
<DicomAttribute keyword="PixelData" tag="7FE00010" vr="OB">
<BulkData uri="file:$h264Path?offsets=0,0&lengths=0,468860"/>
</DicomAttribute>
The resulting dicom file looks to be about the correct size (470kb) and I have also looked at the dcm file via 'od -hc' and the dicom appears to be constructed correctly.
Per the dicom spec I believe I have to specify 2 offsets, where the first is 0 offset and 0 length, and the second is the actual fragment (and only 1 reqd since its less than 4GB in size). I think the fragment offset for the data is supposed to be 0, but I am not certain and that the length should be actual mpeg file size in bytes. The documentation for how to handle such data is non-existent other than what little I can glean from google.
Thus any help would be appreciated in how to handle the BulkData xml tag.
Also if there is some other way to embed the mpeg file via xml2data that would awesome. From what I have read online, the OFFIS DCMTK version of xml2dcm seems to allow one to to just specify the filename to be embedded and it takes care of the offsets for you. I don't think the dcm4che xml2dcm is as 'helpful'.
For reference, here is the resulting dicom file dump.
Thanks,
Mike
- x00080008 length=16; VR=CS; "DERIVED\PRIMARY"
- x00080012 length=8; VR=DA; "20170203"
- x00080013 length=10; VR=TM; "153336.929"
- x00080016 length=32; VR=UI; "1.2.840.10008.5.1.4.1.1.77.1.4.1"
- x00080018 length=44; VR=UI; "1.2.826.0.1.3680043.9.3574.1.1.153336857.1.1"
- x00080020 length=8; VR=DA; "20170203"
- x00080021 length=8; VR=DA; "20170203"
- x00080022 length=8; VR=DA; "20160224"
- x00080023 length=8; VR=DA; "20160224"
- x00080030 length=10; VR=TM; "213334.816"
- x00080031 length=10; VR=TM; "213334.816"
- x00080032 length=10; VR=TM; "213444.000"
- x00080033 length=10; VR=TM; "213444.000"
- x00080050 length=12; VR=SH; "IM257493524"
- x00080060 length=2; VR=CS; (19542)"VL"
- x00080064 length=2; VR=CS; (18771)"SI"
- x00080070 length=12; VR=LO; "xxxxxxxxxxxx"
- x00080090 length=0; VR=PN;
- x00081030 length=14; VR=LO; "PATIENT PHOTO"
- x0008103e length=6; VR=LO; "PHOTO"
- x00081040 length=4; VR=LO; (1819047278)"null"
- x00081050 length=22; VR=PN; "Mfld Ct Scanner Picker"
- x00081070 length=4; VR=PN; (1819047278)"null"
- x00081090 length=10; VR=LO; "ImageMover"
- x00082218 length=0; VR=SQ;
- x00100010 length=28; VR=PN; "Testing-Ris^Aaron^EPaul^ERev"
- x00100020 length=8; VR=LO; "2019314"
- x00100030 length=8; VR=DA; "19570601"
- x00100040 length=2; VR=CS; (8269)"M"
- x00180015 length=0; VR=CS;
- x00180040 length=2; VR=IS; (12339)"30"
- x00181020 length=6; VR=LO; "1.1.2"
- x00181063 length=6; VR=DS; "33.33"
- x0020000d length=40; VR=UI; "1.2.826.0.1.3680043.9.3574.1.1.153336417"
- x0020000e length=42; VR=UI; "1.2.826.0.1.3680043.9.3574.1.1.153336859.1"
- x00200010 length=2; VR=SH; (8241)"1"
- x00200011 length=2; VR=IS; (8241)"1"
- x00200013 length=2; VR=IS; (8241)"1"
- x00200020 length=0; VR=CS;
- x00200060 length=0; VR=CS;
- x00280002 length=2; VR=US; (3)" "
- x00280004 length=16; VR=CS; "YBR_PARTIAL_420"
- x00280006 length=2; VR=US; (0)""
- x00280008 length=2; VR=IS; (12593)"11"
- x00280009 length=4; VR=AT; (274923544)" "
- x00280010 length=2; VR=US; (1920)
- x00280011 length=2; VR=US; (1080)"8 "
- x00280100 length=2; VR=US; (8)" "
- x00280101 length=2; VR=US; (8)" "
- x00280102 length=2; VR=US; (7)" "
- x00280103 length=2; VR=US; (0)""
- x00282110 length=2; VR=CS; (12592)"01"
- x00380400 length=10; VR=LO; "Outpatient"
- x00400555 length=0; VR=SQ;
- x7fe00010 length=468884 (-1); VR=OB;
- Fragment #0 offset = 0(undefined); length = 468860
- x00020000 length=4; VR=UL; (190)
- x00020001 length=2; VR=OB; (256)""
- x00020002 length=32; VR=UI; "1.2.840.10008.5.1.4.1.1.77.1.4.1"
- x00020003 length=44; VR=UI; "1.2.826.0.1.3680043.9.3574.1.1.153336857.1.1"
- x00020010 length=24; VR=UI; "1.2.840.10008.1.2.4.102"
- x00020012 length=26; VR=UI; "1.2.826.0.1.3680043.9.3574"
- x00020013 length=10; VR=SH; "xxxxxxxxxx"