Eidolon
Classes | Functions | Variables
eidolon.plugins.DicomPlugin Namespace Reference

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
 

Function Documentation

◆ addDicomTagsToMap()

def eidolon.plugins.DicomPlugin.addDicomTagsToMap (   dcm,
  tagmap 
)
Here is the caller graph for this function:

◆ convertToDict()

def eidolon.plugins.DicomPlugin.convertToDict (   dcm)
Here is the caller graph for this function:

◆ createDicomDatasets()

def eidolon.plugins.DicomPlugin.createDicomDatasets (   process,
  rootdir,
  files 
)
Reads the listed Dicom files from the given directory and returns DicomDataset objects containing collected info.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDicomReadThread()

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.
Here is the caller graph for this function:

◆ DicomSharedImage()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractOverlay()

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.

◆ getSeriesTagMap()

def eidolon.plugins.DicomPlugin.getSeriesTagMap (   series)
Here is the call graph for this function:

◆ isPhaseImage()

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.

◆ loadDicomZipFile()

def eidolon.plugins.DicomPlugin.loadDicomZipFile (   filename,
  includeTags = False 
)
Here is the call graph for this function:

◆ loadSharedImages()

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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDicomHeartRate()

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.
Here is the caller graph for this function:

◆ readDicomMMap()

def eidolon.plugins.DicomPlugin.readDicomMMap (   fullpath,
  kwargs 
)

◆ readDicomTimeValue()

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.
Here is the caller graph for this function:

◆ roundHeaderVals()

def eidolon.plugins.DicomPlugin.roundHeaderVals (   vals)
Yield each of `vals' rounded to `headerPrecision'.
Here is the caller graph for this function:

Variable Documentation

◆ afterStart

afterStart = Tag(0x0019,0x1016)

◆ colsTag

string colsTag = 'Columns'

◆ commentTag

string commentTag = 'ImageComments'

◆ digestFilename

string digestFilename = 'dicomdataset.ini'

◆ headerPrecision

int headerPrecision = 4

◆ interTag

string interTag = 'RescaleIntercept'

◆ keywordToTag

dictionary keywordToTag = {v[4]:Tag(k) for k,v in DicomDictionary.items()}

◆ NonstandardTags

NonstandardTags
Initial value:
1 = enum(
2  ('USpixdimx', Tag(0x0018, 0x602c)),
3  ('USpixdimy', Tag(0x0018, 0x602e)),
4  ('USpixdimz', Tag(0x3001, 0x1003)),
5  ('USnumframes',Tag(0x0028, 0x0008)),
6  ('USheight', Tag(0x0028, 0x0010)),
7  ('USwidth', Tag(0x0028, 0x0011)),
8  ('USdepth', Tag(0x3001, 0x1001)),
9  ('USpixeldata',Tag(0x7fe0, 0x0010))
10 )

◆ orientationTag

string orientationTag = 'ImageOrientationPatient'

◆ positionTag

string positionTag = 'ImagePositionPatient'

◆ rowsTag

string rowsTag = 'Rows'

◆ seriesTag

string seriesTag = 'SeriesInstanceUID'

◆ slopeTag

string slopeTag = 'RescaleSlope'

◆ spacingTag

string spacingTag = 'PixelSpacing'

◆ triggerTag

string triggerTag = 'TriggerTime'