pyworkflow.utils.dataset module

# JMRT (2018-12-11) This module is almost not used at all. Maybe it can be removed in a future. Just kept here for the moment inside pw.utils and not imported by default

class pyworkflow.utils.dataset.Column(colName, colType=None, default=None, label=None, renderType=0)[source]

Bases: object

convert(value)[source]

Try to convert the value to the column type.

getDefault()[source]
getLabel()[source]
getName()[source]
getRenderType()[source]
getType()[source]
hasDefault()[source]
setRenderType(renderType)[source]
class pyworkflow.utils.dataset.DataSet(tables, tableName=None, volumeName=None, numberSlices=0)[source]

Bases: object

Holds several Tables All tables should have an unique tableName.

currentTable()[source]

Returns the name of the last selected table.

getNumberSlices()[source]
getNumberSlicesForTemplate()[source]
getTable(tableName=None)[source]
getTypeOfColumn(label)[source]

this method should be implemented by subclasses.

getVolumeName()[source]
listTables()[source]

List the actual table names on the DataSet.

setNumberSlices(numberSlices)[source]
setVolumeName(volumeName)[source]
class pyworkflow.utils.dataset.SingleFileDataSet(filename)[source]

Bases: pyworkflow.utils.dataset.DataSet

DataSet implementation for single files such as Images or Volumes.

class pyworkflow.utils.dataset.SqliteDataSet(filename)[source]

Bases: pyworkflow.utils.dataset.DataSet

Provide a DataSet implementation based on sqlite file. The tables of the dataset will be the object tables in database. Each block is a table on the dataset.

class pyworkflow.utils.dataset.Table(*columns)[source]

Bases: object

Table to hold rows of data. A table contains a list of columns.

addRow(rowId, **values)[source]

With this implementation the rowId should be provided. We need to work around to also allow automatic generation of id’s

getColumn(columnName)[source]
getColumnValues(columnName)[source]
getColumns()[source]

Return all columns.

getDataToRender()[source]
getDataToRenderAndExtra()[source]
getIdColumn()[source]
getIndexFromValue(value, label)[source]

Search the element that has property ‘label’ equals to value and returns its index.

getNumberOfColumns()[source]
getRow(rowId)[source]
getRows()[source]

Return all rows.

getSize()[source]

Return the number of rows.

getTransformationMatrix()[source]
getValueFromIndex(index, label)[source]

Return the value of the property ‘label’ in the element that has this ‘index’.

hasColumn(columnName)[source]

Return true if column exists

hasEnabledColumn()[source]

Return true if enabled column exists

iterColumns()[source]
iterRows()[source]

Iterate over the rows.

setLabelToRender(labelToRender)[source]
updateRow(rowId, **values)[source]

Update a row given its rowId and some values to update.