Feature request: add standalone pipeline for segmentation
Opened this issue · 5 comments
Bug report
Hi, I tried to follow the steps "https://janeliascicomp.github.io/multifish/QuickStart.html" for installation, i suceed to install Nextflow and Singularity, and clone the repository, and found the "download_dataset.sh" is not available in the current version:
Provided the error:
(multifish_conda) kms102104:~/multifish$ ./setup.sh
Extracting Starfinity model...
./setup.sh: line 18: /home/kms102104/multifish/data-sets/download_dataset.sh: No such file or directory
I wish to try your segmentation tool individually as th overview page intoduced that some of these modules can be executed individually, using alternative main-*.nf scripts in the root project directory. However, i couldnt find "main-segmentation.nf" file in the git. Please help.
Thank you.
Environment
- EASI-FISH Pipeline version: [2.2.0]
- Nextflow version: [21.10.6]
- Container runtime: [Singularity]
- Platform: [Local]
- Operating system: [Linux]
Hi, @KMSmichelle ,
Thanks for reporting this, we have fixed the error.
Currently, we don't have a way to run the segmentation alone, but we'll definitely consider adding that for a future release.
As a workaround in the meantime, you could run the main pipeline and skip every step except segmentation:
--skip stitching,spot_extraction,registration,warp_spots,measure_intensities,assign_spots
You'll would just need to stage your input data into the stitching/acq_name/export.n5
directory, which is where the segmentation step expects it. I recommend running the demo_tiny test so that you can see what the file structure looks like, and then mimic that.
Best regards,
Konrad
Hi, @KMSmichelle ,
Thanks for your interest in the pipeline! You should be able to run segmentation independently on a workstation with gpu.
Starfinity can be installed directly with pip.
pip install git+https://github.com/mpicbg-csbd/stardist@refinement
For testing segmentation with our model, you can download our model here. And you can run the attached .py code to generate predictions (tif files work fine). If you would like to train your own model, please also install Augmend and gputools (optional).
Hope this helps!
starfinity_prediction.py.zip
Best,
Yuhan
Hi Michelle,
Depending on the type of augmentation you would like to do, you may change the function to something like this. Please refer to Augmend for details of these function.
from augmend import Augmend, FlipRot90, Elastic, IntensityScaleShift, AdditiveNoise
def augmenter(x,y):
aug = Augmend()
aug.add([FlipRot90(axis=(1,2)),FlipRot90(axis=(1,2))])
aug.add([IntensityScaleShift(scale_range=(.5,2), shift_range=(-.5,.5)),Identity()])
aug.add([Elastic(axis = (0,1,2),amount=6, grid =6, order=0, use_gpu = True),
Elastic(axis = (0,1,2),amount=6, grid =6, order=0, use_gpu = True)],
probability=.8)
aug.add([AdditiveNoise(sigma=0.03),Identity()], probability=.5)
return aug([x,y])
Also in model.train(X_trn, Y_trn, validation_data=(X_val,Y_val), augmenter=augmenter)