Example #1
0
    def _cli(cls, args, print_help=False):
        """Runs the pixel finder component based on parsed arguments."""

        if args.pixel_finder_algorithm_class is None or print_help:
            cls.pixel_finder_group.print_help()
            cls.pixel_finder_group.exit(status=2)

        print('Detecting Pixels...')
        s = Stack()
        s.read(args.input)
        instance = args.pixel_finder_algorithm_class(**vars(args))
        # TODO does this work?
        pixel_attributes, encoded_pixels = instance.find(s)

        # TODO ambrosejcarr: this still needs to be added back.
        # if args.show:
        #     encoded_pixels.show(figsize=(10, 10))

        path = os.path.join(args.output, 'pixels.geojson')
        print(f"Writing | pixels geojson to: {path}")
        pixel_attributes.save_geojson(path)

        path = os.path.join(args.output, 'pixels.json')
        print(f"Writing | spot_id | x | y | z | to: {path}")
        pixel_attributes.save(path)

        path = os.path.join(args.output, 'encoder_table.json')
        print(f"Writing | spot_id | hyb | ch | val | to: {path}")
        encoded_pixels.save(path)
Example #2
0
    def _cli(cls, args, print_help=False):
        """Runs the filter component based on parsed arguments."""

        if args.filter_algorithm_class is None or print_help:
            cls.filter_group.print_help()
            cls.filter_group.exit(status=2)

        print('Filtering images ...')
        s = Stack()
        s.read(args.input)
        instance = args.filter_algorithm_class(**vars(args))
        instance.filter(s)

        s.write(args.output)
Example #3
0
def merfish_stack() -> Stack:
    """retrieve MERFISH testing data from cloudfront and expose it at the module level

    Notes
    -----
    Because download takes time, this fixture runs once per session -- that is, the download is run only once.

    Returns
    -------
    Stack :
        starfish.io.Stack object containing MERFISH data
    """
    s = Stack()
    s.read('https://s3.amazonaws.com/czi.starfish.data.public/20180607/test/MERFISH/fov_001/experiment_new.json')
    return deepcopy(s)
Example #4
0
    def _cli(cls, args, print_help=False):
        """Runs the registration component based on parsed arguments."""
        if args.registration_algorithm_class is None or print_help:
            cls.register_group.print_help()
            cls.register_group.exit(status=2)

        instance = args.registration_algorithm_class(**vars(args))

        from starfish.io import Stack

        print('Registering ...')
        s = Stack()
        s.read(args.input)

        instance.register(s)

        s.write(args.output)
from showit import image, tile
# EPY: END code

# EPY: START markdown
# ## Raw Data
#
# The raw data can be downloaded and formatted for analysis by running: ```python examples/get_iss_data.py ><raw data directory> <output directory> --d 1``` from the Starfish directory
# EPY: END markdown

# EPY: START code
from starfish.io import Stack

# replace <output directory> with where you saved the formatted data to with the above script
in_json = '<output directory>/org.json'

s = Stack()
s.read(in_json)

tile(s.squeeze(), size=10)
# EPY: END code

# EPY: START code
image(s.aux_dict['dots'], size=10)
# EPY: END code

# EPY: START markdown
# ## Register
# EPY: END markdown

# EPY: START code
from starfish.registration._fourier_shift import compute_shift, shift_im