You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/README.md
+27-8Lines changed: 27 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,41 @@
1
1
# Segmentation for large lightsheet volumes
2
2
3
+
4
+
## Installation
5
+
6
+
Needs [torch-em](https://github.com/constantinpape/torch-em) in the python environment. See [here](https://github.com/constantinpape/torch-em?tab=readme-ov-file#installation) for installation instructions. (If possible use `mamba` instead of `conda`.)
7
+
After setting up the environment you also have to add support for the MoBIE python library via
8
+
```
9
+
conda install -c conda-forge mobie_utils
10
+
```
11
+
12
+
3
13
## Training
4
14
5
15
Contains the scripts for training a U-Net that predicts foreground probabilties and normalized object distances.
6
16
17
+
7
18
## Prediction
8
19
9
-
Contains the scripts for running segmentation for a large volume with a distance prediction U-Net. (Other scripts are work in progress.)
20
+
Contains the scripts for running segmentation for a large volume with a distance prediction U-Net, postprocessing the segmentation
21
+
and exporting the segmentation result to MoBIE
10
22
11
-
You can run it like this for input that is stored in n5:
23
+
To run the full segmentation workflow, including the export to MoBIE you can use the `segmentation_workflow.py` script as follows:
Here, `-i` must point to the xml file of the fused data exported from BigSticher, `-o` indicates the output folder where the MoBIE project with the semgentation result will be saved, `--scale` indicates the scale to use for the segmentation, `-m` the name of the data in MoBIE and `--model` the path to the segmentation model.
29
+
30
+
### Individual Workflow Steps
31
+
32
+
You can also run individual steps of the workflow, like prediction and segmentation:
33
+
34
+
You can run it like this for an input volume that is stored in n5, e.g. the fused export from bigstitcher:
Here, `-i` specifies the input filepath, `-o` the folder where the results are saved and `-k` the internal path for a zarr or n5 file.
38
+
Here, `-i` specifies the input filepath, `-o` the folder where the results are saved and `-k` the internal path in the n5 file.
16
39
The `-m` argument specifies the model to use for prediction. You need to give the path to the folder that contains the checkpoint (the `best.pt` file).
17
40
18
41
You can also run the script for a tif file. In this case you don't need the `-k` parameter:
@@ -31,8 +54,4 @@ to downsample the input by a factor of 2. Note that the segmentation result will
31
54
32
55
In addition, the script `postprocess_seg.py` can be used to filter out false positive nucleus segmentations from regions in the segmentation with a low density of segmented nuclei.
33
56
34
-
You can use the script `to_tif.py` to convert the zarr object to a tif volume for easier viewing (won't work for very large volumes!).
35
-
36
-
## Installation
37
-
38
-
Needs [torch-em](https://github.com/constantinpape/torch-em) in the python environment. See [here](https://github.com/constantinpape/torch-em?tab=readme-ov-file#installation) for installation instructions. (If possible use `mamba` instead of `conda`.)
57
+
You can use the script `to_tif.py` to convert the zarr object to a tif volume for easier viewing (won't work for large volumes!).
0 commit comments