cleverdoc.dicom package#

Submodules#

cleverdoc.dicom.BaseDicom module#

class cleverdoc.dicom.BaseDicom.BaseDicom#

Bases: object

get_s3_creds(sql_ctx)#
readMaxBytes = Param(parent='undefined', name='readMaxBytes', doc='readMaxBytes.')#
read_dicom(dicom, params, origin='', stop_before_pixels=True)#
setReadMaxBytes(value)#

Sets the value of readMaxBytes.

cleverdoc.dicom.DicomDrawBoxes module#

class cleverdoc.dicom.DicomDrawBoxes.DicomCleaner(compression, forceCompress=False, removePrivateTags=True, tags=[])#

Bases: object

OVERLAY_TAG = 24576#
clean(fix_interpretation=True, pixel_data_attribute='PixelData')#
clean_frame(dicom, index, regions, mask_value=0)#
number_of_frames(dataset) int#

int: Number of frames

open(dicom_file, regions, scaleFactor)#
save_dicom(origin)#
class cleverdoc.dicom.DicomDrawBoxes.DicomDrawBoxes#

Bases: Transformer, HasInputCols, HasOutputCol, DefaultParamsReadable, DefaultParamsWritable, HasKeepInput

Draw regions to dicom.

aggCols = Param(parent='undefined', name='aggCols', doc='agg column names.')#
blackList = Param(parent='undefined', name='blackList', doc='List of tags for clear.')#
static clean_tag_name(tag)#
compression = Param(parent='undefined', name='compression', doc='Compression type.')#
forceCompress = Param(parent='undefined', name='forceCompress', doc='True - Force compress image. False - compress only in case original image was compressed.')#
get_tags()#
removePrivateTags = Param(parent='undefined', name='removePrivateTags', doc='Remove private tags.')#
scaleFactor = Param(parent='undefined', name='scaleFactor', doc='Scale factor.')#
setAggCols(value)#

Sets the value of filledRect.

setCompression(value)#

Sets the value of compression.

setForceCompress(value)#

Sets the value of forceCompress.

setScaleFactor(value)#

Sets the value of scaleFactor.

transform_dicom(dicom, regions)#
exception cleverdoc.dicom.DicomDrawBoxes.NoImage#

Bases: Exception

cleverdoc.dicom.DicomDrawBoxes.write_dataset_to_bytes(dataset)#

cleverdoc.dicom.DicomToImage module#

class cleverdoc.dicom.DicomToImage.DicomToImage(*args, **kwargs)#

Bases: Transformer, HasInputCols, HasOutputCol, HasKeepInput, HasOrigin, JavaMLReadable, JavaMLWritable, BaseDicom, LicenseValidator

Transform Dicom Binary Content to the Image

add_image(arr, ds, f, origin)#
frameLimit = Param(parent='undefined', name='frameLimit', doc='Limit number of frames for extraction. For extract all frames need to set this param to 0.')#
get_input_col(dataset, col_type, required=False, position=0)#
metadataCol = Param(parent='undefined', name='metadataCol', doc='Output column name for dicom metatdata.')#
pageNumCol = Param(parent='undefined', name='pageNumCol', doc='Page number output column name.')#
scale = Param(parent='undefined', name='scale', doc='Width of the desired input image. Image will be resized to this width.')#
setFrameLimit(value)#

Sets the value of frameLimit.

setInputCols(value)#

Sets the value of inputCol.

setMetadataCol(value)#

Sets the value of metadataCol.

setOutputCol(value)#

Sets the value of outputCol.

setPageNumCol(value)#

Sets the value of pageNumCol.

setScale(value)#

Sets the value of inputCol.

transform_dicom(origin, parts, dicom, params)#

Extract frames(images) from the dicom file

@param origin: Path to the file (generated by the binaryFile spark datasource) @param parts: List of the frames for extract @param dicom: Binary data or path to the local file @return: Rows with image, exception and number of frame for each item

Module contents#