44import dask .array as da
55
66
7- def get_czi_zebrafish_data (view : bool = False ) -> da .Array :
7+ def get_czi_zebrafish_data (
8+ neuromast : bool = True , view : bool = False
9+ ) -> da .Array :
810 """Gets the CZI ZebraFish light-sheet microscopy data.
911 NOTE: Currently, we support only the raw data.
1012
@@ -15,20 +17,29 @@ def get_czi_zebrafish_data(view: bool = False) -> da.Array:
1517 The daskified chunky array.
1618 """
1719 # NOTE: Let's try for one link first, we can generalize it later.
18- url = "https://public.czbiohub.org/royerlab/ultrack/zebrafish_embryo.ome.zarr"
1920
21+ if neuromast :
22+ # Link for nuclear and membrane labeled zebrafish neuromast.
23+ url = "https://public.czbiohub.org/royerlab/ultrack/zebrafish_neuromast.ome.zarr"
24+ else :
25+ # Link for dense nuclear labeled zebrafish embryo.
26+ # NOTE: This data does not have tracking annotations!
27+ url = "https://public.czbiohub.org/royerlab/ultrack/zebrafish_embryo.ome.zarr"
28+
29+ # First, let's get the image data
2030 reader = Reader (parse_url (url )) # Prepare a reader.
2131 nodes = list (reader ()) # Might include multiple stuff
2232 image_node = nodes [0 ] # First node is expecte to be image pixel data.
2333
2434 dask_data = image_node .data # Get the daskified data.
2535
2636 # HACK: Try it for one dask array with lowest resolution (there exists four resolutions in this data).
27- curr_data = dask_data [- 1 ] # TODO: Control dimensions from here, the highest res starts at the first index.
37+ # TODO: Control res below, the highest res starts at the first index, lowest at the last index.
38+ curr_data = dask_data [- 1 ]
2839
2940 # We don't care about the over-time information. Let's get the 3d info for now!
3041 # I am removing the channel dimension here (OG dimension style: (T, C, Z, Y, X))
31- curr_data = curr_data [:, 0 ] # TODO: Parse values in the time or z-dimension to parse limited slices?
42+ curr_data = curr_data [:, 0 ] # TODO: Parse values in the time or z-dimension to access limited slices?
3243
3344 # NOTE: The following line of code brings the entire dask array in memory.
3445 # curr_data = curr_data.compute()
@@ -42,7 +53,7 @@ def get_czi_zebrafish_data(view: bool = False) -> da.Array:
4253
4354
4455def main ():
45- image = get_czi_zebrafish_data (view = False )
56+ image = get_czi_zebrafish_data (neuromast = True , view = False )
4657 print (image .shape )
4758
4859
0 commit comments