Skip to content

Commit

Permalink
Merge pull request #127 from dcm4che/dcm4chee-arc-light#758
Browse files Browse the repository at this point in the history
dcm4che-tool-jpg2dcm: OutOfMemoryError on larger input (video) files
  • Loading branch information
hczedik committed Jul 3, 2017
2 parents 3b2b49c + a1c012a commit 3424e29
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 52 deletions.
64 changes: 32 additions & 32 deletions dcm4che-tool/dcm4che-tool-jpg2dcm/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
usage: jpg2dcm [Options] <jpgfile> <dcmfile>

Supports conversion of pixel data (with extensions jpg, jpeg, mpg, mpeg, mpg2) to DICOM.
Metadata can be specified via command line (using -m option) or a file (using -f option).
Character set ISO_IR 100 will be used as default charset, if not specified in metadata.
File names should not contain spaces.
usage: jpg2dcm [options] <jpeg-file>|<mpeg2-file> <dicom-file>

Encapsulate JPEG image or MPEG2 video (with file extensions jpeg, jpg,
jpe; mpeg, mpg, mpe) into DICOM files. DICOM attributes can be specified
via command line (using -a option) or a XML file (using -f option).
-
Options:
-f,--file <file> Specify the file (in XML format) containing the metadata
or DICOM attributes.
-h,--help Print this message
-m,--metadata Specify metadata attributes. Attribute can be specified
by keyword or tag value (in hex),
e.g. PatientName or 00100010. Attributes in nested
Datasets can be specified by including the keyword/tag
value of the sequence attribute,
e.g. 00400275/00400009 for
Scheduled Procedure Step ID in the Request.
-na,--no-appn Exclude application segments APPn from JPEG
stream; encapsulate JPEG stream verbatim by
default.
-V,--version Print the version information and exit
--
Example 1: Encapulate JPEG Image verbatim with DICOM attributes or metadata
specified in the xml file into DICOM Image Object:
$ jpg2dcm -f jpg2dcm.xml image.jpg image.dcm
--
Example 2: Encapulate JPEG Image without application segments and with system generated
DICOM attributes into DICOM Image Object:
$ jpg2dcm -na true homer.jpg image.dcm
--
Example 3: Encapulate MPEG2 Video with specified DICOM attributes into
DICOM Video Object:
$ jpg2dcm -f mpg2dcm.xml video.mpg video.dcm
-a <[seq/]attr=value> specify included DICOM Attribute. attr can be
specified by keyword or tag value (in hex), e.g.
PatientName or00100010. Attributes in nested
Datasets can be specified by including the
keyword/tag value of the sequence attribute,e.g.
00400275/00400009 for Scheduled Procedure Step ID
in the Request Attributes Sequence. Overrides
DICOM attributesspecified by -f <xml-file>
-f <xml-file> specify included DICOM attributes by XML
presentation in <xml-file>
-h,--help display this help and exit
--no-app remove application segments APPn from
encapsulated JPEG stream; encapsulate JPEG stream
verbatim by default.
-V,--version output version information and exit
-
Example 1: jpg2dcm -f metadata.xml image.jpg image.dcm
=> Encapulate JPEG Image verbatim with DICOM attributes specified in
metadata.xml into DICOM Image Object.
-
Example 2: jpg2dcm --no-app -a PatientName=Simson^Homer -a PatientSex=M
homer.jpg image.dcm
=> Encapulate JPEG Image without application segments with specified DICOM
attributes into DICOM Image Object.
-
Example 3: jpg2dcm video.mpg video.dcm
=> Encapulate MPEG2 Video into DICOM Video Object.
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
usage=jpg2dcm [options] image.jpg image.dcm
usage=jpg2dcm [options] <jpeg-file>|<mpeg2-file> <dicom-file>
try=Try `jpg2dcm --help' for more information.
description=\n\
Supports conversion of pixel data (with extensions jpg, jpeg, mpg, mpeg, mpg2) to DICOM. \
Metadata can be specified via command line (using -m option) or a file (using -f option). \
Character set ISO_IR 100 will be used as default charset, if not specified in metadata. \
File names should not contain spaces. \n\-\n\
Encapsulate JPEG image or MPEG2 video (with file extensions jpeg, jpg, jpe; mpeg, mpg, mpe) into DICOM files. \
DICOM attributes can be specified via command line (using -a option) or a XML file (using -f option).\n\-\n\
Options:
example=-\n\
Example 1: jpg2dcm -f jpg2dcm.xml image.jpg image.dcm \n\
=> Encapulate JPEG Image verbatim with DICOM attributes or metadata \
specified in the xml file into DICOM Image Object. \n\-\n\
Example 2: jpg2dcm -na true homer.jpg image.dcm \n\
=> Encapulate JPEG Image without application segments and with system generated \
DICOM attributes into DICOM Image Object. \n\-\n\
Example 3: jpg2dcm -f mpg2dcm.xml video.mpg video.dcm \n\
=> Encapulate MPEG2 Video with specified DICOM attributes into \
DICOM Video Object. \n\
metadata=specify metadata attributes. attr can be specified by keyword or tag value \
(in hex), e.g. PatientName or 00100010. Attributes in nested Datasets can be \
specified by including the keyword/tag value of the sequence attribute, \
e.g. 00400275/00400009 for Scheduled Procedure Step ID in the Request.
file=Specify the file (in XML format) containing the metadata or DICOM attributes.
no-appn=Specify value as true if application segments APPn are to be excluded from JPEG stream; encapsulate JPEG stream verbatim by default.
Example 1: jpg2dcm -f metadata.xml image.jpg image.dcm\n\
=> Encapulate JPEG Image verbatim with DICOM attributes specified in metadata.xml into DICOM Image Object.\n\-\n\
Example 2: jpg2dcm --no-app -a PatientName=Simson^Homer -a PatientSex=M homer.jpg image.dcm\n\
=> Encapulate JPEG Image without application segments with specified DICOM attributes into DICOM Image Object.\n\-\n\
Example 3: jpg2dcm video.mpg video.dcm\n\
=> Encapulate MPEG2 Video into DICOM Video Object.\n\
attr=specify included DICOM Attribute. attr can be specified by keyword or tag value (in hex), e.g. PatientName or\
00100010. Attributes in nested Datasets can be specified by including the keyword/tag value of the sequence attribute,\
e.g. 00400275/00400009 for Scheduled Procedure Step ID in the Request Attributes Sequence. Overrides DICOM attributes\
specified by -f <xml-file>
file=specify included DICOM attributes by XML presentation in <xml-file>
no-app=remove application segments APPn from encapsulated JPEG stream; encapsulate JPEG stream verbatim by default.
missing=missing file operand
too-many=too many arguments
invalid-file-ext=unrecognized file extension of {0}
file-too-large={0} too large
failed-to-parse=failed to detect {0} header in {1}
converted={0} -> {1}

0 comments on commit 3424e29

Please sign in to comment.