Commit 6e4a4c40 authored by amichaut's avatar amichaut
Browse files

added static files

parent 1f27f174
Pipeline #55695 failed with stage
in 17 seconds
import os.path as osp
import sys
import argparse
import numpy as np
from skimage.io import imread
import tifffile as tifff
def parse_args(args=None):
"""
Parse arguments for main()
"""
parser = argparse.ArgumentParser()
parser.add_argument('data_dir',
help='path of the data directory')
parsed_args = parser.parse_args(args)
return parsed_args
def main(args=None):
"""
Main function to extract images from dataset and save it as a tiff stack
Freely inspired from napari tutorial: https://napari.org/tutorials/applications/cell_tracking.html
"""
# number of images
NUM_IMAGES = 195
# load and check argument
args = sys.argv[1:] if args is None else args
parsed_args = parse_args(args)
data_dir = osp.realpath(parsed_args.data_dir)
if not osp.exists(data_dir):
raise Exception("ERROR: the passed data directory does not exist. Aborting...")
if not osp.isdir(data_dir):
raise Exception("ERROR: the passed data directory is not a directory. Aborting...")
# extract images
stack = np.asarray([imread(osp.join(data_dir, '01', f't{i:0>3}.tif')) for i in range(NUM_IMAGES)])
#save_image
tifff.imsave(osp.join(data_dir,'stack.tif'), stack)
if __name__ == '__main__':
main()
This image diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
.. Track Analyzer - Quantification and visualization of tracking data
Authors: Arthur Michaut
Copyright 2016-2019 Harvard Medical School and Brigham and
Women's Hospital
Copyright 2019-2021 Institut Pasteur and CNRS–UMR3738
See the COPYRIGHT file for details
This file is part of Track Analyzer package.
Track Analyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Track Analyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with Track Analyzer (COPYING).
If not, see <https://www.gnu.org/licenses/>.
===============
Developer Guide
===============
Under construction
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment