Package gov.nih.mipav.model.dicomcomm
Class DICOM_Receiver
java.lang.Object
gov.nih.mipav.model.dicomcomm.DICOM_Comms
gov.nih.mipav.model.dicomcomm.DICOM_PDUService
gov.nih.mipav.model.dicomcomm.DICOM_Receiver
- All Implemented Interfaces:
Observable,Runnable
This is the DICOM server class that hangs a listener on a given port for incoming image store requests from a remote
DICOM client.
This DICOM communication package was originally based on the Java Dicom Package, whose license is below:
This DICOM communication package was originally based on the Java Dicom Package, whose license is below:
Java Dicom Package (com.zmed.dicom) Copyright (c) 1996-1997 Z Medical Imaging Systems, Inc. This software is provided, as is, for non-commercial educational purposes only. Use or incorporation of this software or derivative works in commercial applications requires written consent from Z Medical Imaging Systems, Inc. Z MEDICAL IMAGING SYSTEMS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR CONFORMANCE TO ANY SPECIFICATION OR STANDARD. Z MEDICAL IMAGING SYSTEMS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING OR MODIFYING THIS SOFTWARE OR ITS DERIVATIVES. ============================================================================= This software package is implemented similarly to the UC Davis public domain C++ DICOM implementation which contains the following copyright notice: Copyright (C) 1995, University of California, Davis THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND THE UNIVERSITY OF CALIFORNIA DOES NOT MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH THE USER. Copyright of the software and supporting documentation is owned by the University of California, and free access is hereby granted as a license to use this software, copy this software and prepare derivative works based upon this software. However, any distribution of this software source code or supporting documentation or derivative works (source code and supporting documentation) must include this copyright notice. The UC Davis C++ source code is publicly available from the following anonymous ftp site: ftp://imrad.ucdmc.ucdavis.edu/pub/dicom/UCDMC/
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThread manager for running the DICOM receiver.Nested classes/interfaces inherited from class gov.nih.mipav.model.dicomcomm.DICOM_Comms
DICOM_Comms.ByteBuffer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SocketSocket used to receive the data.private booleanFlag to indicate if the receive process should be cancelled.private booleanDOCUMENT ME!private static intUsed to number XRay image file names so that they are numbered differently.private StringDOCUMENT ME!private final VectorDOCUMENT ME!private final VectorDOCUMENT ME!private intPort number used to accept data.private DICOM_Comms.ByteBufferDOCUMENT ME!private byte[]DICOM part 10 preample buffer.private ServerSocketSocket manager.private DICOM_Receiver.RunnerThreadThread object manager for running receiver.private final StringA semicolon delimited list of the storage properties to use for this receiverprivate final DICOM_VerificationReference to the DICOM verification object.Fields inherited from class gov.nih.mipav.model.dicomcomm.DICOM_PDUService
abortRQ, associateAC, associateRJ, associateRQ, compData, dicomMessageDisplayer, findResults, ioBuffer, moveResults, pDataTF, PresentationContexts, proposedAbstractSyntaxs, releaseRQ, releaseRSP, socketFields inherited from class gov.nih.mipav.model.dicomcomm.DICOM_Comms
BIG_ENDIAN, breakSize, inBuffersLength, incomingBuffers, LITTLE_ENDIAN, MAX_READ_LENGTH, outBuffersLength, outgoingBuffers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.private voidBuilds buffer of DICOM part 10 preamble and require Part 10 group 2 tags.voidMarks this object as no longer having been changed.intReturns the number of the observers of this Observable object.private booleanCreates the initial server socket binded to the given port.voidDeletes an observer from the set of observers of this object.voidClears the observer list so that this object no longer has any observer.voidfinalize()DOCUMENT ME!Returns the default storage directory for the received dicom files.booleanTest if this object has changed.booleanisAlive()Checks to see if the thread controlling the receivers execution is alive.voidStarts the DICOM image receiver.voidnotifyObservers(Object obj) If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.voidreceiverClient(Socket socket) Routine to Process a DICOM Store Request.voidresetPort(int port) Resets the port and changes where the receiver is listening.voidrun()Run method so that this receiver can execute in its own thread.voidsetCancelled(boolean flag) Turns the cancelled flag on or off.voidMarks this object as having been changed.voidsetStop()Stops the receiver thread.voidstart(int priority) Checks to see if a thread is already running on this object, and if not starts it.Methods inherited from class gov.nih.mipav.model.dicomcomm.DICOM_PDUService
addAbstractSyntax, addAllSupportedAbstractSyntaxes, addFindResultToList, addJustVerificationAbstractSyntax, close, connectClientToServer, getAAssociateRQ, getImplementationClassUID, getImplementationVersion, getLocalAppTitle, getTransferSyntaxID, handleConnectionFromServer, parseDICOMintoBuffer, parseDICOMIntoRawVR, parseRawVRIntoDICOM, parseServerInfo, readBinary, readDICOMDataObjectFromFile, readInObject, saveImageToFile, sendBinary, setDICOMMessageDisplayer, shouldWeAcceptLocalAppTitle, shouldWeAcceptRemoteAppTitle, showMessage, write, writeMethods inherited from class gov.nih.mipav.model.dicomcomm.DICOM_Comms
bufferToInt16, bufferToInt32, flush, flush, getIncomingEndian, getIncomingSize, getOutgoingEndian, getOutgoingSize, int16ToBuffer, int32ToBuffer, peekFirstByte, peekForEndOfSequence, read, read, readByte, readBytes, readFill, readInt32, readShort16, seekToEndOfGroupTwoTags, setIncomingEndianess, setOutgoingEndianess, write, write, writeByte, writeByteIn, writeIn, writeInt32, writeInt32In, writeShort16, writeShort16In
-
Field Details
-
crNum
private static int crNumUsed to number XRay image file names so that they are numbered differently. -
acceptedSocket
Socket used to receive the data. -
cancelled
private boolean cancelledFlag to indicate if the receive process should be cancelled. Cancel if true. -
changed
private boolean changedDOCUMENT ME! -
defaultStorageDir
DOCUMENT ME! -
storageProperty
A semicolon delimited list of the storage properties to use for this receiver -
fileNameList
DOCUMENT ME! -
observerList
DOCUMENT ME! -
port
private int portPort number used to accept data. -
pre_and_fullData
DOCUMENT ME! -
preambleBuffer
private byte[] preambleBufferDICOM part 10 preample buffer. -
recSocket
Socket manager. -
runner
Thread object manager for running receiver. -
verification
Reference to the DICOM verification object.
-
-
Constructor Details
-
DICOM_Receiver
public DICOM_Receiver()Constructor that starts the thread. -
DICOM_Receiver
-
-
Method Details
-
addObserver
Description copied from interface:ObservableAdds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.- Specified by:
addObserverin interfaceObservable- Parameters:
o- an observer object.- See Also:
-
clearChanged
public void clearChanged()Description copied from interface:ObservableMarks this object as no longer having been changed.- Specified by:
clearChangedin interfaceObservable- See Also:
-
countObservers
public int countObservers()Description copied from interface:ObservableReturns the number of the observers of this Observable object.- Specified by:
countObserversin interfaceObservable- Returns:
- the number of the observers of this Observable object.
- See Also:
-
deleteObserver
Description copied from interface:ObservableDeletes an observer from the set of observers of this object.- Specified by:
deleteObserverin interfaceObservable- Parameters:
o- an observer object.- See Also:
-
deleteObservers
public void deleteObservers()Description copied from interface:ObservableClears the observer list so that this object no longer has any observer.- Specified by:
deleteObserversin interfaceObservable- See Also:
-
finalize
public void finalize()DOCUMENT ME!- Overrides:
finalizein classDICOM_PDUService
-
getDefaultStorageDir
Returns the default storage directory for the received dicom files.- Returns:
- the default storage directory for the received dicom files.
-
hasChanged
public boolean hasChanged()Description copied from interface:ObservableTest if this object has changed.- Specified by:
hasChangedin interfaceObservable- Returns:
- true if the object has changed.
- See Also:
-
isAlive
public boolean isAlive()Checks to see if the thread controlling the receivers execution is alive.- Returns:
- flag indicating whether or not the thread is alive
-
mipavReceiver
public void mipavReceiver()Starts the DICOM image receiver. -
notifyObservers
Description copied from interface:ObservableIf this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.- Specified by:
notifyObserversin interfaceObservable- Parameters:
obj- the argument object- See Also:
-
receiverClient
Routine to Process a DICOM Store Request.- Parameters:
socket- this is a socket
-
resetPort
public void resetPort(int port) Resets the port and changes where the receiver is listening.- Parameters:
port- port to listen on
-
run
public void run()Run method so that this receiver can execute in its own thread. -
setCancelled
public void setCancelled(boolean flag) Turns the cancelled flag on or off.- Parameters:
flag- indicator flag
-
setChanged
public void setChanged()Description copied from interface:ObservableMarks this object as having been changed.- Specified by:
setChangedin interfaceObservable- See Also:
-
setStop
public void setStop()Stops the receiver thread. -
start
public void start(int priority) Checks to see if a thread is already running on this object, and if not starts it.- Parameters:
priority- thread priority
-
createServerSocket
private boolean createServerSocket()Creates the initial server socket binded to the given port. If unable to be created, will return without having started the dicom receiver.- Parameters:
port-
-
addPreambleAndGroupTwoTags
Builds buffer of DICOM part 10 preamble and require Part 10 group 2 tags.- Parameters:
dco- DICOM_Object DICOM command object needed to extract UID information to be included in the preample.
-