Eidolon
|
Classes | |
class | ChooseSeriesDialog |
class | DicomDataset |
class | DicomPlugin |
class | DicomSeries |
class | SeriesPropertyWidget |
class | TestDicomPlugin |
class | TimeMultiSeriesDialog |
Functions | |
def | roundHeaderVals (vals) |
def | readDicomMMap (fullpath, kwargs) |
def | readDicomHeartRate (series_or_dcm) |
def | readDicomTimeValue (series_or_dcm) |
def | createDicomReadThread (rootpath, files, readPixels=True) |
def | createDicomDatasets (process, rootdir, files) |
def | loadSharedImages (process, rootdir, files, crop=None) |
def | loadDicomZipFile (filename, includeTags=False) |
def | convertToDict (dcm) |
def | addDicomTagsToMap (dcm, tagmap) |
def | getSeriesTagMap (series) |
def | isPhaseImage (image) |
def | extractOverlay (image) |
def | DicomSharedImage (filename, index=-1, isShared=False, rescale=True, dcm=None, includeTags=False) |
Variables | |
string | digestFilename = 'dicomdataset.ini' |
int | headerPrecision = 4 |
dictionary | keywordToTag = {v[4]:Tag(k) for k,v in DicomDictionary.items()} |
string | positionTag = 'ImagePositionPatient' |
string | orientationTag = 'ImageOrientationPatient' |
string | slopeTag = 'RescaleSlope' |
string | interTag = 'RescaleIntercept' |
string | seriesTag = 'SeriesInstanceUID' |
string | spacingTag = 'PixelSpacing' |
string | rowsTag = 'Rows' |
string | colsTag = 'Columns' |
string | triggerTag = 'TriggerTime' |
string | commentTag = 'ImageComments' |
afterStart = Tag(0x0019,0x1016) | |
NonstandardTags | |
def eidolon.plugins.DicomPlugin.addDicomTagsToMap | ( | dcm, | |
tagmap | |||
) |
def eidolon.plugins.DicomPlugin.convertToDict | ( | dcm | ) |
def eidolon.plugins.DicomPlugin.createDicomDatasets | ( | process, | |
rootdir, | |||
files | |||
) |
Reads the listed Dicom files from the given directory and returns DicomDataset objects containing collected info.
def eidolon.plugins.DicomPlugin.createDicomReadThread | ( | rootpath, | |
files, | |||
readPixels = True |
|||
) |
Reads the Dicom files in `rootpath' listed by relative file names in the list `files', and returns the reading thread object and the synchronized queue containing (relative-filenames,Dicom-object) pairs produced by the thread.
def eidolon.plugins.DicomPlugin.DicomSharedImage | ( | filename, | |
index = -1 , |
|||
isShared = False , |
|||
rescale = True , |
|||
dcm = None , |
|||
includeTags = False |
|||
) |
This pseudo-constructor creates a SharedImage object from a DICOM file. If `dcm' is None then the file is read from `filename', which must always be the valid path to the loaded DICOM, otherwise `dcm' must be the loaded Dicom object. The `index' value is for the ordering the caller imposes on a series of DICOM images, usually this is the index of the image in its containing DICOM series. If `isShared' is True the image matrix is allocated in shared memory. If `rescale' is True then the image data is rescaled according to the slope and intercept tags. The `timestep' value of the returned object is defined by the TriggerTime tag or inferred from the image comment if not present. Additional members are defined for the returned SharedImage object: * seriesID: string of the SeriesInstanceUID tag value or '' * imageType: string of the ImageType tag * isSpatial: is True if there's a valid pixel array and image position/orientation tags * isCompressed: True if the image data is compressed in a way which can't be read * tags: a dictionary of the Dicom tags taken from the loaded file if `includeTags' is True, {} otherwise
def eidolon.plugins.DicomPlugin.extractOverlay | ( | image | ) |
Given a SharedImage with its Dicom tags present, extract the overlay data and assign it to the image matrix of the returned copy of `image'. If `image' doesn't have overlay data a blank copy of it is returned instead.
def eidolon.plugins.DicomPlugin.getSeriesTagMap | ( | series | ) |
def eidolon.plugins.DicomPlugin.isPhaseImage | ( | image | ) |
Returns True if the SharedImage or Dicom image object `image' has a tag field indicating the image is phase.
def eidolon.plugins.DicomPlugin.loadDicomZipFile | ( | filename, | |
includeTags = False |
|||
) |
def eidolon.plugins.DicomPlugin.loadSharedImages | ( | process, | |
rootdir, | |||
files, | |||
crop = None |
|||
) |
Reads the image data from the listed files and returns a list of SharedImage objects storing this image data.
def eidolon.plugins.DicomPlugin.readDicomHeartRate | ( | series_or_dcm | ) |
Attempt to retrieve the heart rate in BPM from the DicomSeries or Dicom object `series_or_dcm'. If the "HeartRate" tag is present then this is used, otherwise attempt to parse the RR or bpm value from the "ImageComments" tag if this is present. The comment should be something like "RR 1153 +/- 41; 138 heartbeats" or contain a BPM value like "56 bpm" for this to work. If no heart rate is found then return None.
def eidolon.plugins.DicomPlugin.readDicomMMap | ( | fullpath, | |
kwargs | |||
) |
def eidolon.plugins.DicomPlugin.readDicomTimeValue | ( | series_or_dcm | ) |
Attempt to determine a timing value from the DicomSeries or Dicom object `series_or_dcm'. This will try to use the TriggerTime tag but will then attempt to read a phase value from the ImageComment tag, this should work for CT images which don't use TriggerTime. Returns the determined time or -1 if none was found.
def eidolon.plugins.DicomPlugin.roundHeaderVals | ( | vals | ) |
Yield each of `vals' rounded to `headerPrecision'.
afterStart = Tag(0x0019,0x1016) |
string colsTag = 'Columns' |
string commentTag = 'ImageComments' |
string digestFilename = 'dicomdataset.ini' |
int headerPrecision = 4 |
string interTag = 'RescaleIntercept' |
dictionary keywordToTag = {v[4]:Tag(k) for k,v in DicomDictionary.items()} |
NonstandardTags |
string orientationTag = 'ImageOrientationPatient' |
string positionTag = 'ImagePositionPatient' |
string rowsTag = 'Rows' |
string seriesTag = 'SeriesInstanceUID' |
string slopeTag = 'RescaleSlope' |
string spacingTag = 'PixelSpacing' |
string triggerTag = 'TriggerTime' |