Fiji

We add support to Fiji [6] software by providing I/O and a runner class that enables running script with Fiji headless.

Utilities for inputs/outputs with icy

byotrack.fiji.io.save_detections(detections_sequence: Collection[Detections], path: str | PathLike) None

Save a sequence of detections as a stack of segmentation that can be reload by the trackmate label detector

Warning

Only supports consecutive detections

Parameters:
  • detections_sequence (Collection[Detections]) – Detections for each frame (Should be consecutives)

  • path (str | os.PathLike) – Output path

byotrack.fiji.io.load_tracks(path: str | PathLike) Collection[Track]

Load tracks saved by trackmate

Currently only 2d tracks are supported

Format example:

<TrackMate>
    <Model>
        <AllSpots>
            <SpotsInFrame frame="0">
                <Spot ID="2811" POSITION_X="552.0" POSITION_Y="143.0" POSITION_Z="0.0">...</Spot>
                ...
            </SpotsInFrame>
            ...
        </AllSpots>
        <AllTracks>
            <Track TRACK_ID="0">
                <Edge SPOT_SOURCE_ID="24068" SPOT_TARGET_ID="20796"/>
                ...
            </Track>
        </AllTracks>
    </Model>
</TrackMate>
Parameters:

path (str | os.PathLike) – Input path

Returns:

Parsed tracks

Return type:

Collection[Track]

class byotrack.fiji.run.FijiRunner(fiji_path: str | PathLike)

Bases: object

Runs icy in headless with specified protocol and arguments

fiji_path

Path to the fiji executable The executable can be found inside the installation folder of Fiji. Linux: Fiji.app/ImageJ-<os>.exe Windows: Fiji.app/ImageJ-<os>.exe MacOs: Fiji.app/Contents/MacOs/ImageJ-<os>

Type:

str | os.PathLike

run(script: str | PathLike, **kwargs) int

Runs fiji with the given script and additional kwargs

Parameters:
  • script (str | os.PathLike) – Path to a Fiji script file

  • **kwargs – Additional arguments given as key=value to the cmd line

Returns:

Return code of fiji

Return type:

int