public class MC
extends java.lang.Object
The methods of this class can be used by multiple threads concurrently.
Modifier and Type | Class and Description |
---|---|
static class |
MC.MemoryStatus
This class represents the toolkit's native memory status information.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
cleanupMemory(int timeout)
Releases unused native memory held by the toolkit.
|
static java.util.Map<java.lang.Integer,java.lang.String> |
getDicomKeywords() |
static boolean |
getRenumberPrivateAttributes()
Tells if private tags are renumbered on copying in sequent order.
|
static boolean |
getReportInvalidEncoding()
Tells whether the toolkit throws exception when an application tries to set an invalid value for an attribute.
|
static MCstringEncoder |
getStringEncoder()
Gets the object used by the toolkit for encoding/decoding string attribute values.
|
static java.lang.String |
getVersionString()
Retrieves library version information.
|
static void |
initialize(java.io.File mergeIniFile)
Initializes the Merge DICOM toolkit.
|
static void |
initialize(java.io.File mergeIniFile,
java.lang.String license)
Initializes the Merge DICOM Toolkit.
|
static boolean |
isInitialized()
Determines whether the toolkit is currently initialized.
|
static void |
release()
Performs a graceful shutdown of the toolkit.
|
static void |
reportActiveMCObjects()
Reports the active toolkit objects (attribute sets, applications, associations) to the toolkit's log file.
|
static MC.MemoryStatus |
reportNativeMemory()
Reports the current native memory usage of the toolkit.
|
static void |
setRenumberPrivateAttributes(boolean on)
Sets a flag to renumber private tags on copying in sequent order.
|
static void |
setReportInvalidEncoding(boolean on)
Sets a flag that controls how the toolkit deals with invalid attribute values.
|
static void |
setStringEncoder(MCstringEncoder encoder)
Sets the object used by the toolkit for encoding/decoding string attribute values.
|
static void |
unloadLibraries()
Releases the native libraries dynamically loaded by the toolkit
|
public static MCstringEncoder getStringEncoder()
By default the toolkit uses it's internal encoder which in turn uses uses the system's character set encoders,
provided by the java.nio.charset.Charset
class.
MCstringEncoder
interface.public static void setStringEncoder(MCstringEncoder encoder)
By default the toolkit uses it's internal encoder which in turn uses uses the system's character set encoders,
provided by the java.nio.charset.Charset
class.
encoder
- An object implementing the MCstringEncoder
interface.public static void setReportInvalidEncoding(boolean on)
The default value for this flag is true
meaning that the toolkit will not tolerate setting invalid
attribute values.
on
- If set to true
the toolkit will throw exceptions whenever the application sets an invalid
value for an attribute. If set to false
the toolkit will tolerate most invalid values set by the
application.public static boolean getReportInvalidEncoding()
true
if the toolkit is set to not tolerate invalid attribute values.public static void setRenumberPrivateAttributes(boolean on)
The default value for this flag is true
meaning that the toolkit will renumber private tags.
on
- If set to true
the toolkit will renumber private tags on copying in sequent order.public static boolean getRenumberPrivateAttributes()
true
if the toolkit is set to renumber private tags.public static java.lang.String getVersionString()
public static void initialize(java.io.File mergeIniFile)
This method must be the first toolkit method called by an application. It provides information needed by the toolkit to retrieve configuration information.
This method may be called multiple times (by multiple application threads, for example) but the
mergeIniFile
parameter must specify the same file path. Each call must be paired with a
corresponding release()
call. After all required release()
calls have been made,
the toolkit will permit an initialize()
call using a different merge ini file.
An application can use the isInitialized()
method to determine if the toolkit is initialized.
The Merge DICOM toolkit native dynamic link library, mc3adv_xxx.dll (Windows platform) or mc3adv_xxx.so (Unix platform), is loaded as a result of this call. The Java Virtual Machine searches for the library using the platform's normal search path or the locations specified by the java.library.path VM property.
mergeIniFile
- A File object containing the merge.ini file location.MCexception
- If the toolkit is already initialized or the license is invalid.isInitialized()
,
release()
public static void initialize(java.io.File mergeIniFile, java.lang.String license)
This method must be the first toolkit method called by an application. It provides information needed by the toolkit to retrieve configuration information.
This method may be called multiple times (by multiple application threads, for example) but the
mergeIniFile
parameter must specify the same file path. Each call must be paired with a
corresponding release()
call. After all required release()
calls have been made,
the toolkit will permit an initialize()
call using a different merge ini file.
An application can use the isInitialized()
method to determine if the toolkit is initialized.
The Merge DICOM toolkit native dynamic link library, mc3adv_xxx.dll (Windows platform) or mc3adv_xxx.so (Unix platform), is loaded as a result of this call. The Java Virtual Machine searches for the library using the platform's normal search path or the locations specified by the java.library.path VM property.
mergeIniFile
- A File
object containing the initialization file location or null
to use the default initialization file, merge.ini.license
- An string representing a valid license for Merge DICOM library. If this parameter is
null the license information is retrieved from the toolkit's profile settings (mergecom.pro).MCexception
- If the toolkit is already initialized or the license is invalid.isInitialized()
,
release()
public static boolean isInitialized()
true
if the toolkit is initialized.initialize(File)
,
release()
public static void release()
This call is ignored if the library is not initialized.
The toolkit is not released until a release()
is called for each successful
initialize(java.io.File)
call.
Note that releasing the toolkit while the application is using the toolkit in another call may result in undetermined behavior. An application should ensure that all threads using the toolkit terminate before calling this method.
isInitialized()
public static boolean cleanupMemory(int timeout)
This method allows an application to reduce the amount of native memory consumed by the toolkit.
The native toolkit uses an internal memory management system to increase performance. This increase in performance is at the expense of keeping allocated memory blocks available by not freeing them to the operating system. This call allows memory blocks that are not in use to be returned to the operating system.
This call can take a significant amount of time if a large amount of memory is to be freed. The timeout can
be used to make incremental reductions in the memory usage. Calls to this method pick up where the previous
call left off. If the timeout expires before the cleanup is complete, false
is returned.
timeout
- A timeout, in seconds, for the cleanup. If this parameter is zero, the method runs until
the cleanup is complete.true
if the cleanup is complete, false
if the operation timed out.public static void unloadLibraries()
public static MC.MemoryStatus reportNativeMemory()
MC.MemoryStatus
object containing native memory usage information.public static void reportActiveMCObjects()
public static java.util.Map<java.lang.Integer,java.lang.String> getDicomKeywords()