pwem.protocols.protocol_import.images module

class pwem.protocols.protocol_import.images.ProtImportImages(**kwargs)[source]

Bases: ProtImportFiles

Common protocol to import a set of images into the project.

fillAcquisition(acquisition)[source]

Fill the acquition object with protocol params.

getAcquisition()[source]

Build and fill an acquisition object.

getActions()[source]

This method will allow that the ‘Stop import’ action to appears in the GUI when the user right-click in the protocol import box. It will allow a user to manually stop the streaming.

getFileNamesList()[source]

Fill a list with the file names that contains extra folder

getFiles()[source]
handleImgHed(copyOrLink, src, dst)[source]

Check the special case of Imagic files format composed by two files: .hed and .img. When copying or linking we need to take care of the other one.

importImagesStep(pattern, voltage, sphericalAberration, amplitudeContrast, magnification)[source]

Copy images matching the filename pattern Register other parameters.

importImagesStreamStep(pattern, voltage, sphericalAberration, amplitudeContrast, magnification)[source]

Copy images matching the filename pattern Register other parameters.

iterNewInputFiles()[source]

Iterate over input files that have not been imported. This function uses the self.importedFiles dict.

loadAcquisitionInfo()[source]

Return a proper acquistionInfo (dict) or an error message (str).

processImportDict(importDict, importDir)[source]

This function is used when we import a workflow from a json. If we need to include source data for reproducibility purposes, this function will make the necessary changes in the protocol dict to include the source data. Params:

  • importDict: import dictionary coming from the json

  • importDir: directory containing the json file

stopImport(e)[source]

Since the actual protocol that is running is in a different process that the one that this method will be invoked from the GUI, we will use a simple mechanism to place an special file to stop the streaming.

stopStreamingFileExists()[source]
classmethod validatePath(pathstr)[source]