Class MultiModalitySimulator
- java.lang.Object
-
- com.pixelmed.apps.MultiModalitySimulator
-
public class MultiModalitySimulator extends java.lang.ObjectThis class implements a multi-modality simulator that takes a database of existing studies to provide a source of sample images and DICOM attributes, and for each modality within the database, generates random new patients and studies at random intervals using the current date and time.
For example:
try { new MultiModalitySimulator("theirhost",11112,"STORESCP","STORESCU","database"); } catch (Exception e) { slf4jlogger.error("",e); }From the command line:
java -cp pixelmed.jar:lib/additional/commons-codec-1.3.jar:lib/additional/commons-compress-1.12.jar com.pixelmed.network.MultiModalitySimulator theirhost 11112 STORESCP database
The database is a persistent (disk) instance of the
DatabaseInformationModel, such as might be created by theRebuildDatabaseFromInstanceFilesclass from a set of files, or have been created by an application storing received images in such a databaase.The Calling AE Title used to send the images for each simulated modality is the modality string value, e.g. "CT" for images with a DICOM Atttibute Modality (0008,0060) of "CT".
The list of modalities simulated is currently limited to CT, MR, DX, CR, US, NM, XA, MG, SR, PR if present in the supplied database. This can be changed in a subclass by overriding the protected variable
modalities, as can the corresponding protected variablesleepIntervalForModalityInMinutes, which needs to contain a matching number of entries.A relatively short and contrived list of patient names is used by default, and can be overridden in a subclass by changing
patientNames.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classMultiModalitySimulator.OurMultipleInstanceTransferStatusHandlerprotected classMultiModalitySimulator.SpecificModalitySimulator
-
Field Summary
Fields Modifier and Type Field Description protected static longaccessionNumberCounterprotected java.lang.StringcalledAETitleprotected DatabaseInformationModeldatabaseInformationModelprotected intdefaultSleepIntervalMultiplierprotected java.lang.Stringhostnameprotected java.lang.StringlocalFileNameColumnNameprotected static java.lang.String[]modalitiesprotected java.lang.StringmodalityColumnNameprotected java.lang.String[]patientNamesprotected intportprotected java.lang.StringseriesLocalParentReferenceColumnNameprotected java.util.Map<java.lang.String,java.lang.Integer>sleepIntervalForModalityprotected static int[]sleepIntervalForModalityInMinutesprotected intsleepIntervalMultiplier
-
Constructor Summary
Constructors Constructor Description MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName)Simulate modalities sending to the specified AE.MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName, int debugLevel)Simulate modalities sending to the specified AE.MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName, java.lang.String sleepIntervalMultiplier)Simulate modalities sending to the specified AE.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voiddeleteFiles(SetOfDicomFiles dicomFiles)protected voidfindFilesToSend(InformationEntity ie, java.lang.String localPrimaryKeyValue, java.util.List<java.lang.String> dicomFiles)protected SetOfDicomFilesgenerateSyntheticStudyFromOriginal(java.util.List<java.lang.String> originalDicomFileNames, java.lang.String modality, java.lang.String aeTitleForMetaInformation, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String accessionNumber)protected intgetSleepIntervalForModalityInMilliseconds(java.lang.String modality)static voidmain(java.lang.String[] arg)Simulate modalities sending to the specified AE.
-
-
-
Field Detail
-
modalities
protected static java.lang.String[] modalities
-
sleepIntervalForModalityInMinutes
protected static int[] sleepIntervalForModalityInMinutes
-
sleepIntervalForModality
protected java.util.Map<java.lang.String,java.lang.Integer> sleepIntervalForModality
-
defaultSleepIntervalMultiplier
protected int defaultSleepIntervalMultiplier
-
sleepIntervalMultiplier
protected int sleepIntervalMultiplier
-
accessionNumberCounter
protected static long accessionNumberCounter
-
patientNames
protected java.lang.String[] patientNames
-
seriesLocalParentReferenceColumnName
protected java.lang.String seriesLocalParentReferenceColumnName
-
localFileNameColumnName
protected java.lang.String localFileNameColumnName
-
modalityColumnName
protected java.lang.String modalityColumnName
-
databaseInformationModel
protected DatabaseInformationModel databaseInformationModel
-
hostname
protected java.lang.String hostname
-
port
protected int port
-
calledAETitle
protected java.lang.String calledAETitle
-
-
Constructor Detail
-
MultiModalitySimulator
public MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName, java.lang.String sleepIntervalMultiplier) throws DicomExceptionSimulate modalities sending to the specified AE.
- Parameters:
hostname- their hostnameport- their portcalledAETitle- their AE Title,databaseFileName- the source database file namesleepIntervalMultiplier- ms to sleep for one minute- Throws:
DicomException
-
MultiModalitySimulator
public MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName) throws DicomExceptionSimulate modalities sending to the specified AE.
- Parameters:
hostname- their hostnameport- their portcalledAETitle- their AE Title,databaseFileName- the source database file name- Throws:
DicomException
-
MultiModalitySimulator
public MultiModalitySimulator(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String databaseFileName, int debugLevel) throws DicomExceptionSimulate modalities sending to the specified AE.
- Parameters:
hostname- their hostnameport- their portcalledAETitle- their AE Title,databaseFileName- the source database file namedebugLevel- ignored- Throws:
DicomException
-
-
Method Detail
-
getSleepIntervalForModalityInMilliseconds
protected int getSleepIntervalForModalityInMilliseconds(java.lang.String modality)
-
findFilesToSend
protected void findFilesToSend(InformationEntity ie, java.lang.String localPrimaryKeyValue, java.util.List<java.lang.String> dicomFiles) throws DicomException
- Throws:
DicomException
-
generateSyntheticStudyFromOriginal
protected SetOfDicomFiles generateSyntheticStudyFromOriginal(java.util.List<java.lang.String> originalDicomFileNames, java.lang.String modality, java.lang.String aeTitleForMetaInformation, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String accessionNumber) throws DicomException, java.io.IOException
- Throws:
DicomExceptionjava.io.IOException
-
deleteFiles
protected static void deleteFiles(SetOfDicomFiles dicomFiles)
-
main
public static void main(java.lang.String[] arg)
Simulate modalities sending to the specified AE.
- Parameters:
arg- array of four strings - their hostname, their port, their AE Title, the source database name, and optionally a sleep interval multiplier (in ms, defaults to ms in one minute)
-
-