com.goldenhammer.modality
Class Modality

java.lang.Object
  extended bycom.goldenhammer.modality.Modality
All Implemented Interfaces:
java.io.Serializable

public class Modality
extends java.lang.Object
implements java.io.Serializable

This class simulates a modality(i.e CR,CT,MRI,etc.)

See Also:
Serialized Form

Field Summary
static java.lang.String AE_TITLE
           
static float FINISHED
           
static java.lang.String IMAGE_SIZE
           
static java.lang.String MODALITY
           
static java.lang.String MODALITY_ID
           
static java.lang.String MODEL
           
static java.lang.String SEND_DURATION
           
static java.lang.String SEND_TIME
           
static float STOPPED
           
static java.lang.String TYPE
           
static java.lang.String VENDOR
           
static float WAITING
           
 
Constructor Summary
Modality()
          Constructor
Modality(java.lang.String xmlProfilePath)
          Constructs a new modality with the data from the XML profile.
Modality(java.lang.String xmlProfilePath, java.util.logging.Logger logger)
          Constructs a new modality with the data from the XML profile.
 
Method Summary
 void addStudy(Study study)
          Add the given study to the studies
 void doEcho()
          This method echos the server
 void doStoreImage(java.io.File file, DICOMHeaderData header)
          Stores the image located at the path specified by the File parameter
 void doStoreImage(java.lang.String path, DICOMHeaderData header)
          Stores the image located at the path specified by the String parameter
 void finish()
          Notifies the modality that the simulation is finished
 java.lang.String getApplicationEntityTitle()
           
 java.lang.String getLoggerName()
          Gets the logger name for this modality
 java.lang.String getManufacturer()
           
 java.lang.String getModalityID()
           
 int getModalityNumber()
           
 ModalityStats getModalityStats()
          Returns the ModalityStats object for this modality.
 java.lang.String getModel()
           
 java.lang.String getProfilePath()
          Returns the path to the XML file used to create this Modality.
 java.lang.String getSenderName()
          Returns the sender name assigned to this instance.
 float getStatus()
          Gets the status of this modality with regard to its completion of the simulation
 java.util.Collection getStudies()
           
 java.lang.String getType()
           
 void save(java.lang.String filename)
          Saves this modality to an XML file.
 void setApplicationEntityTitle(java.lang.String applicationEntityTitle)
           
 void setLoggerName(java.lang.String name)
          Sets the logger name for this modality
 void setManufacturer(java.lang.String manufacturer)
           
 void setModalityID(java.lang.String modalityID)
           
 void setModalityNumber(int modalityNumber)
          Sets the modality number, which is used to identify the images that this modality sends.
 void setModel(java.lang.String model)
           
 void setProfilePath(java.lang.String profile)
           
 void setSenderName(java.lang.String senderName)
          Sets the sender name for this modality instance.
 void setStatus(float newStatus)
          Sets the status of the modality with regard to its completion of the simulation
 void setStudies(java.util.Collection studies)
          Adds studies to this modality.
 void setType(java.lang.String type)
           
 void stop()
          Notifies the modality that it should stop what it is doing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VENDOR

public static final java.lang.String VENDOR
See Also:
Constant Field Values

MODALITY

public static final java.lang.String MODALITY
See Also:
Constant Field Values

MODEL

public static final java.lang.String MODEL
See Also:
Constant Field Values

MODALITY_ID

public static final java.lang.String MODALITY_ID
See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

AE_TITLE

public static final java.lang.String AE_TITLE
See Also:
Constant Field Values

STOPPED

public static final float STOPPED
See Also:
Constant Field Values

FINISHED

public static final float FINISHED
See Also:
Constant Field Values

WAITING

public static final float WAITING
See Also:
Constant Field Values

IMAGE_SIZE

public static final java.lang.String IMAGE_SIZE
See Also:
Constant Field Values

SEND_TIME

public static final java.lang.String SEND_TIME
See Also:
Constant Field Values

SEND_DURATION

public static final java.lang.String SEND_DURATION
See Also:
Constant Field Values
Constructor Detail

Modality

public Modality(java.lang.String xmlProfilePath,
                java.util.logging.Logger logger)
         throws ModalityException,
                java.io.IOException
Constructs a new modality with the data from the XML profile.

Parameters:
xmlProfilePath - The path to the XML profile.
logger - A logger to use for this modality.
Throws:
ModalityException - thrown if there is a problem parsing the xml document.
java.io.IOException - thrown if the XML profile could not be found.

Modality

public Modality(java.lang.String xmlProfilePath)
         throws ModalityException,
                java.io.IOException
Constructs a new modality with the data from the XML profile.

Parameters:
xmlProfilePath - The path to the XML profile.
Throws:
ModalityException - thrown if there is a problem parsing the xml document.
java.io.IOException - thrown if the XML profile could not be found.

Modality

public Modality()
Constructor

Method Detail

doEcho

public void doEcho()
This method echos the server


doStoreImage

public void doStoreImage(java.io.File file,
                         DICOMHeaderData header)
Stores the image located at the path specified by the File parameter

Parameters:
file - File object that indicates the path where the image being sent is located
header - the object containing the header data for the image being stored. If this is null, then the header data from file will be used.

doStoreImage

public void doStoreImage(java.lang.String path,
                         DICOMHeaderData header)
Stores the image located at the path specified by the String parameter

Parameters:
path - string that indicates the path where the image being sent is located
header - the object containing the header data for the image being stored. If this is null, then the header data from file will be used.

getApplicationEntityTitle

public java.lang.String getApplicationEntityTitle()
Returns:
Returns the applicationEntityTitle.

setApplicationEntityTitle

public void setApplicationEntityTitle(java.lang.String applicationEntityTitle)
Parameters:
applicationEntityTitle - The applicationEntityTitle to set.

getLoggerName

public java.lang.String getLoggerName()
Gets the logger name for this modality

Returns:
the logger name

setLoggerName

public void setLoggerName(java.lang.String name)
Sets the logger name for this modality

Parameters:
name - The name of the logger for this modality

getManufacturer

public java.lang.String getManufacturer()
Returns:
Returns the manufacturer.

setManufacturer

public void setManufacturer(java.lang.String manufacturer)
Parameters:
manufacturer - The manufacturer to set.

getModalityID

public java.lang.String getModalityID()
Returns:
Returns the modalityID.

setModalityID

public void setModalityID(java.lang.String modalityID)
Parameters:
modalityID - The modalityID to set.

getModalityNumber

public int getModalityNumber()
Returns:
the modalityNumber

setModalityNumber

public void setModalityNumber(int modalityNumber)
Sets the modality number, which is used to identify the images that this modality sends. Must be non-negative, if a negative value is passed the absolute value will be stored.

Parameters:
modalityNumber - the modalityNumber to set

getModel

public java.lang.String getModel()
Returns:
Returns the model.

setModel

public void setModel(java.lang.String model)
Parameters:
model - The model to set.

getType

public java.lang.String getType()
Returns:
Returns the type.

setType

public void setType(java.lang.String type)
Parameters:
type - The type to set.

getStudies

public java.util.Collection getStudies()
Returns:
Returns the studies.

setStudies

public void setStudies(java.util.Collection studies)
Adds studies to this modality.

Parameters:
studies - The studies to add to this modality.

save

public void save(java.lang.String filename)
          throws java.io.IOException
Saves this modality to an XML file.

Parameters:
filename - The desired name of the XML file.
Throws:
java.io.IOException - If the file could not be written.

stop

public void stop()
Notifies the modality that it should stop what it is doing


finish

public void finish()
Notifies the modality that the simulation is finished


setSenderName

public void setSenderName(java.lang.String senderName)
Sets the sender name for this modality instance.

Parameters:
senderName - The name the test profile assigns to this instance.

getSenderName

public java.lang.String getSenderName()
Returns the sender name assigned to this instance.

Returns:
The sender name of this Modality instance.

getProfilePath

public java.lang.String getProfilePath()
Returns the path to the XML file used to create this Modality.

Returns:
The path to the XML file used to create this Modality.

setProfilePath

public void setProfilePath(java.lang.String profile)
Parameters:
profile - The path to the modality's profile.

addStudy

public void addStudy(Study study)
Add the given study to the studies

Parameters:
study - the study to add

getStatus

public float getStatus()
Gets the status of this modality with regard to its completion of the simulation

Returns:
The status of this modality

setStatus

public void setStatus(float newStatus)
Sets the status of the modality with regard to its completion of the simulation

Parameters:
newStatus - The new status of this modality

getModalityStats

public ModalityStats getModalityStats()
Returns the ModalityStats object for this modality.

Returns:
The modality stats object for this modality.