slitflow.load.tif module
- class SingleFile(info_path=None)[source]
Bases:
ImageImport a tiff image as the top level of the observation data.
- Parameters:
reqs[] (None) – Input Data is not required.
param["path"] (str) – Path to a tiff file.
param["length_unit"] (str) – String of length unit such as “um”, “nm”, “pix”. This string is used as column name footers and units.
param["pitch"] (float, optional) – Pixel size in length_unit/pix.
param["interval"] (float, optional) – Time interval.
param["index_cols"] (list of list, optional) – Column names of indexes. Each list should have [depth number, column name, description]. Defaults to [[1, “img_no”,”Image number”]].
param["img_nums"] (list of int, optional) – Set if image numbers are not [1,2,3,…,total_images].
param["value_type"] (str) – Value type of each pixel. “uint8”, “uint16” or “float32”.
param["split_depth"] (int) – File split depth number.
- Returns:
Tiff Image class
- Return type:
Examples
Import a tiff stack as an observation file.
PL = sf.manager.Pipeline(project_directory) path = os.path.join( image_directory, "image.tif") PL.add(sf.load.tif.SingleFile(), 0, (1, 1), "group1", "raw", ["Sample1"], [], [], {"path": path, "length_unit": "um", "pitch": 0.1, "value_type": "uint16", "split_depth": 0}) PL.run() # image_directory/image.tif # is saved as # project_directory/g1_group1/a1_raw/ # - Sample1_raw.tif # with - Sample1.sf, Sample1.sfx
- static process(reqs, param)[source]
Load a tiff file from the path string.
- Parameters:
param["path"] (str) – Tiff file path.
- Returns:
Image stack array
- Return type:
- set_index()[source]
Create index structure of this analysis data.
This step strongly depends on the analysis type. Frequently used processes are in
slitflow.setindex.
- class SplitFile(info_path=None)[source]
Bases:
ImageImport a tiff image as split image of the observation data.
Argument names are defined assuming the observation image data that have several tiff stacks(img_no=1, 2, …) that have several frames(frm_no=1, 2, …). If the image size is big, the split_depth should be more than 0 to avoid memory over. Path, indexes and frm_nos of last image is saved in the info file.
- Parameters:
reqs[0] (slitflow.dev.img.pitch.Grid, optional) – pitch information if it can be provided.
param["path"] (str) – Path to a split tiff file.
param["length_unit"] (str) – String of length unit such as “um”, “nm”, “pix”. This string is used as column name footers and units.
param["pitch"] (float) – Pixel size in length_unit/pix.
param["interval"] (float) – Time interval between two frames.
param["index_cols"] (list of list, optional) – Column names of indexes. Each list should have [depth number, column name, description]. Defaults to [[1, “img_no”, “Image number”], [2, “frm_no”, “Frame number”]].
param["indexes"] (list of int) – Index numbers of the tiff image. For example, if the tiff file is the 3rd image of the observation, set [3].
param["frm_nums"] (list of int, optional) – Set if frame numbers are not [1, 2, 3, …, total_frames].
param["value_type"] (str) – Value type of each pixel. “uint8”, “uint16” or “float32”.
param["split_depth"] (int) – File split depth number.
- Returns:
Tiff Image class
- Return type:
Examples
Import three tiff stacks as the same observation.
PL = sf.manager.Pipeline(project_directory) for i in [1, 2, 3]: path = os.path.join( image_directory, "image-" + str(i) + ".tif") PL.add(sf.load.tif.SplitFile(), 0, (1, 1), "group1", "raw", ["Sample1"], [], [], {"path": path, "length_unit": "um", "pitch": 0.1, "value_type": "uint16", "indexes": [i], "split_depth": 1}) PL.run() # image_directory/ # - image-1.tif, image-2.tif, image-3.tif # is saved as # project_directory/g1_group1/a1_raw/ # - Sample1_D1_raw.tif, Sample1_D2_raw.tif, Sample1_D3_raw.tif # with - Sample1.sf, Sample1.sfx
- set_info(param)[source]
Convert input information to Info object.
This method creates columns and parameters information. The columns information is used to handle data structure. The parameter dictionaries are set as param of
process(). This method is called beforerun(). Implemented in subclass.- Parameters:
param (dict, optional) – Parameters for columns or params.
- static process(reqs, param)[source]
Load a tiff from the path string.
See
SingleFile.process().
- set_index()[source]
Create index structure of this analysis data.
This step strongly depends on the analysis type. Frequently used processes are in
slitflow.setindex.