A class for handling interactions with scan directories.
| Method | __init__ |
Initialise the scan directory. |
| Method | all |
Return a list of all files in the scan dir relative to the dir. |
| Method | get |
Return the filename for the final stitch (in the images dir). |
| Method | get |
Return the modified time of the directory. |
| Method | get |
Return the scan data from the json file as a ScanData model. |
| Method | get |
Return the scan data from the json file as a dictionary. |
| Method | get |
Return a list of the files in the images dir. |
| Method | save |
Save the scan data for this scan to disk. |
| Method | scan |
Return the information to be used in the UI for the scan. |
| Method | zip |
Zips any images from the scan not yet zipped, return full path to zip. |
| Property | created |
The time the directory was created on disk. |
| Property | dir |
The full path to the scan directory. |
| Property | images |
The path to the images directory. |
| Property | name |
The name of the scan. |
| Property | scan |
The path to the scan data json file for this directory. |
| Method | _extract |
Extract files which match the naming convention for dzi_files. |
| Method | _extract |
Extract files which match the naming convention for final stitches. |
| Method | _extract |
Extract files which match the naming convention for scan images. |
| Instance Variable | _base |
Undocumented |
| Instance Variable | _name |
Undocumented |
Initialise the scan directory.
| Parameters | |
name:str | the name of the scan (the scan directory basename). |
basestr | Path of the directory that holds all scans. |
Return a list of all files in the scan dir relative to the dir.
| Parameters | |
skiplist[ | Skip any file in a directory that is on this list. The list should be the basename of the directory. e.g. "scan_0001_files" not "images/scan_0001_files" |
| Returns | |
list[ | Undocumented |
Return the filename for the final stitch (in the images dir).
If no final stitch is found, return None
Return the scan data from the json file as a ScanData model.
| Returns | |
ScanData | None | The data as a ScanData model or None if it couldn't be loaded or valdiated. |
Return the scan data from the json file as a dictionary.
This is safer than get_scan_data for older scans before a defined model was used.
| Returns | |
dict[ | The data as a dictionary or None if it couldn't be loaded. |
Zips any images from the scan not yet zipped, return full path to zip.
final_version Set true to stitch all files not just the scan images this should only be done at the end as it is not possible to update a file in a zip.
The path to the scan data json file for this directory.
Returns None if there is no images dir to write to.
Extract files which match the naming convention for dzi_files.
| Parameters | |
filelist[ | The list of files to search. |
| Returns | |
list[ | The list of files that match the naming convention for dzi_files |
Extract files which match the naming convention for final stitches.
| Parameters | |
filelist[ | The list of files to search. |
| Returns | |
list[ | The list of files that match the naming convention for final stitches |