public class MCutil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MultipleValuesDelimiter
Delimiter of multiple DICOM values
String , equals "\" |
static java.lang.String |
MultipleValuesDelimiterRegEx
Delimiter of multiple DICOM values
String for the regexp search, equals "\\" |
static java.lang.String |
STRING_EMPTY
Empty
String |
Constructor and Description |
---|
MCutil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addGroup2Elements(com.merge.mcw.MCtransferSyntax ts,
com.merge.mcw.MCfile file)
Adds DICOM {0002,xxxx} group attributes to
MCfile object |
static java.lang.String |
aggregate(java.util.Collection<java.lang.String> cols)
Aggregates the list of
String |
static java.lang.String |
aggregate(java.util.Collection<java.lang.String> cols,
java.lang.String separator)
Aggregates the list of
String with given delimiter |
static MCactionType |
getActionType(java.util.Collection<MCparameter> parameters)
Searches
MCactionType action type in the list of MCparameter objects |
static org.w3c.dom.Node |
getChild(org.w3c.dom.Node parent,
java.lang.String name) |
static java.util.Collection<org.w3c.dom.Node> |
getChilds(org.w3c.dom.Node parent,
java.lang.String name) |
static java.lang.String |
getCurrentFolder()
Gets current folder
String |
static java.util.Map.Entry<java.lang.Integer,java.lang.String> |
getDicomKeyword(java.lang.String str)
Gets
Map.Entry with DICOM tag and DICOM keyword for given String |
static java.lang.String |
getExceptionStackTrace(java.lang.Exception ex)
Converts exception stack trace into
String |
static java.lang.String |
getHeaderParameter(org.apache.http.Header header,
java.lang.String name)
Searches Header
String parameter in Apache Header |
static MCrequestType |
getRequestType(java.util.Collection<MCparameter> parameters)
Searches
MCrequestType request type in the list of MCparameter objects |
static java.lang.String |
getUUID()
Gets a new UUID
String |
static boolean |
isEmpty(java.lang.String str)
Checks if
String is empty or null |
static com.merge.mcw.MCattributeSet |
readFileToMCattributeSet(java.lang.String path,
java.lang.Class<?> klass,
MCreference<java.lang.String> error)
Reads DICOM file into
MCfile of MCdimseMessage |
static com.merge.mcw.MCattributeSet |
readStreamToMCattributeSet(java.io.InputStream stream,
java.lang.Class<?> klass,
MCreference<java.lang.String> error)
Reads DICOM stream into
MCfile of MCdimseMessage |
static void |
removeChilds(org.w3c.dom.Node parent) |
static boolean |
writeMCattributeSetToFile(com.merge.mcw.MCattributeSet set,
java.lang.String path,
MCreference<java.lang.String> error)
Writes
MCattributeSet into DICOM file with given name |
static boolean |
writeMCattributeSetToStream(com.merge.mcw.MCattributeSet set,
java.io.OutputStream stream,
MCreference<java.lang.String> error)
Writes
MCattributeSet into DICOM OutputStream |
public static final java.lang.String STRING_EMPTY
String
public static java.lang.String MultipleValuesDelimiter
String
, equals "\"public static java.lang.String MultipleValuesDelimiterRegEx
String
for the regexp search, equals "\\"public static java.lang.String getUUID()
String
String
public static java.lang.String getCurrentFolder()
String
String
public static java.lang.String aggregate(java.util.Collection<java.lang.String> cols)
String
cols
- List of String
to aggregateString
public static java.lang.String aggregate(java.util.Collection<java.lang.String> cols, java.lang.String separator)
String
with given delimitercols
- List of String
to aggregateseparator
- String
separatorString
public static boolean writeMCattributeSetToFile(com.merge.mcw.MCattributeSet set, java.lang.String path, MCreference<java.lang.String> error)
MCattributeSet
into DICOM file with given nameset
- MCattributeSet
objectpath
- Full file name to writeerror
- Contains String
error if the operation failedtrue
if the operation succeededpublic static boolean writeMCattributeSetToStream(com.merge.mcw.MCattributeSet set, java.io.OutputStream stream, MCreference<java.lang.String> error)
MCattributeSet
into DICOM OutputStream
set
- MCattributeSet
objectstream
- OutputStream
objecterror
- Contains String
error if the operation failedtrue
if the operation succeededpublic static com.merge.mcw.MCattributeSet readFileToMCattributeSet(java.lang.String path, java.lang.Class<?> klass, MCreference<java.lang.String> error)
MCfile
of MCdimseMessage
path
- Full DICOM file nameklass
- MCfile.class
or MCdimseMessage.class
classerror
- Contains String
error if the operation failedMCattributeSet
objectpublic static com.merge.mcw.MCattributeSet readStreamToMCattributeSet(java.io.InputStream stream, java.lang.Class<?> klass, MCreference<java.lang.String> error)
MCfile
of MCdimseMessage
stream
- DICOM streamklass
- MCfile.class
or MCdimseMessage.class
classerror
- Contains String
error if the operation failedMCattributeSet
objectpublic static boolean addGroup2Elements(com.merge.mcw.MCtransferSyntax ts, com.merge.mcw.MCfile file)
MCfile
objectts
- DICOM Transfer Syntaxfile
- MCfile
objecttrue
if the operation succeededpublic static boolean isEmpty(java.lang.String str)
String
is empty or nullstr
- String
true
if String
is empty or nullpublic static MCactionType getActionType(java.util.Collection<MCparameter> parameters)
MCactionType
action type in the list of MCparameter
objectsparameters
- List of MCparameter
MCactionType
or MCactionType.Undefined
public static MCrequestType getRequestType(java.util.Collection<MCparameter> parameters)
MCrequestType
request type in the list of MCparameter
objectsparameters
- List of MCparameter
MCrequestType
or MCrequestType.Unknown
public static java.lang.String getHeaderParameter(org.apache.http.Header header, java.lang.String name)
String
parameter in Apache Header
header
- Apache Header
objectname
- String
parameters nameString
parameters valuepublic static java.util.Map.Entry<java.lang.Integer,java.lang.String> getDicomKeyword(java.lang.String str)
Map.Entry
with DICOM tag and DICOM keyword for given String
str
- String
, might be DICOM tag or keywordMap.Entry
with DICOM tag and DICOM keyword or nullpublic static java.lang.String getExceptionStackTrace(java.lang.Exception ex)
String
ex
- Exception
objectString
public static org.w3c.dom.Node getChild(org.w3c.dom.Node parent, java.lang.String name)
public static java.util.Collection<org.w3c.dom.Node> getChilds(org.w3c.dom.Node parent, java.lang.String name)
public static void removeChilds(org.w3c.dom.Node parent)