Closed pr4deepr closed 9 months ago
I checked the shapes of the arrays (xyz):
input_segmentation.shape
was: 577 x 453 x 378
whereas the watershed.shape
was smaller: 284 x 223 x 79..
The larger shapes corresponds to the rescaled image. So, I rescaled the nuclei label image to match the shape of the rescaled membrane prediction. The shape mismatch error disappeared, but now I get another error:
Traceback (most recent call last):
File "/home/rajasekhar.p/.conda/envs/plant-seg/bin/plantseg", line 10, in <module>
sys.exit(main())
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/run_plantseg.py", line 28, in main
raw2seg(config)
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/pipeline/raw2seg.py", line 85, in raw2seg
output_paths = pipeline_step()
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/pipeline/steps.py", line 55, in __call__
return [self.read_process_write(input_path) for input_path in self.input_paths]
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/pipeline/steps.py", line 55, in <listcomp>
return [self.read_process_write(input_path) for input_path in self.input_paths]
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/segmentation/lmc.py", line 105, in read_process_write
output_data = self.process(pmaps)
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/segmentation/lmc.py", line 73, in process
segmentation = segment_volume_lmc_from_seg(boundary_pmaps,
File "/home/rajasekhar.p/.conda/envs/plant-seg/lib/python3.8/site-packages/plantseg/segmentation/lmc.py", line 184, in segment_volume_lmc_from_seg
lifted_costs = lifted_costs[:, 0]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
I checked the shape of lifted_costs
and its (1070,), i.e., its a 1D array.
So, I commented out this line lifted_costs = lifted_costs[:, 0]
The segmentation now works without a problem.
Is there anything that I'm doing wrong or is it a bug with the program? Is it worth adding a check to see if its a 2D or 1D array?
Cheers Pradeep
Hi Pradeep,
Thanks for using plantseg!
About the shape mismatch, that's plantseg fault, the nuclei image is never preprocessed internally (so the setup in the preprocessing config is ignored) and it needs to be 'rescaled' outside plantseg (like in fiji). We are working to change radically plantseg and make the lifted MC workflow better supported. At the moment is still a bit rough and buggy.
About the second error, I have already seen it and I thought it was solved, my guess is that something has changed upstream in elf
. Could you please tell me what version of plantseg and what version of elf do you use? (you can get them from the terminal by using conda list | grep elf
and conda list | grep plantseg
)
I flag this a bug, and look into it.
Best, Lorenzo
Hi @lorenzocerrone
Thanks for the reply.
For elf
:
python-elf | 0.4.0 | pyhd8ed1ab_0 | conda-forge
For plantseg
plantseg | 1.4.2 | py_1 | lcerrone
Also, are there any plans to bring it to Windows in the near future, apart from using docker?
Cheers Pradeep
We actually as of today have native support for windows. I am still testing it around, so I still expect bugs. In the readme you can find the installation instructions.
Best, Lorenzo
Yes, please!! I'm happy to test and give feedback..
Thanks! that would be awesome! :)
It seems to be working fine on Windows. It was a breeze to install as everything is in one conda command. Will let you know if I run into any trouble..
Perfect, thanks a lot for testing it.
In the next days (maybe a week) we will release stand alone binaries for Windows, and a new launcher to allow drag and drop of images and configs on Windows. If you are mostly on Windows those could be useful for you.
Cheers, Lorenzo
Hi I'm having trouble with segmentations using the lifted multicut in PlantSeg. Due to data confidentiality, I'm not allowed to share the data publicly. Is it ok if I send the data link in an email?
Cheers Pradeep
Hey @pr4deepr, I think this problem was fixed in the Napar interface a long time ago (but after this issue ofc). Do you still experience any issue relating to Lifted MultiCut? If not I'll close the issue. Thanks for reporting!
Hi I haven't used this in a while, but I remember it working for me. I'll close this and reopen if needed.
Cheers Pradeep
Hi Thank you for making this software available. I would like to use nuclear prediction label map from StarDist for the Lifted MultiCut segmentation as part of the Plantseg workflow. I had a look at previous closed Issues and it looks like it is possible. and have use following in the yml file
is_segmentation: True
and entered a
nuclei_predictions_path
andHowever, I keep getting this error
assert input_segmentation.shape == watershed.shape
Complete log trace:
I am "Computing a rescaling factor" based on pixel size of the image and the membrane predictions generated during the liftedmulticut appear to be rescaled. I've attached the yml file as txt.
lifted_multicut.yml.txt
I'm assuming I need to rescale the images I use for nuclei prediction? Is there anything I should be aware of here?
Cheers Pradeep