Hey there,
In the context of segmentation of MERSCOPE data using a trained Cellpose 2.0 model with Vizgen's VPT plugin, I finally got around to trying the nuclear expansion method. I downloaded the fork (https://github.com/carsen-stringer/vizgen-postprocessing) into a venv and ran essentially the exact same code that I used prior to run my cellpose 2.0 model via VPT:
When I ran the code, I got the following error:
File "C:\Users\marsdenl\~.venv\vpt-fork-env\lib\site-packages\vpt\prepare_segmentation\validate.py", line 14, in validate_regex_and_alg_match
raise ValueError(f'Z planes from algorithm specification {alg_info.z_layers} do not match '
ValueError: Z planes from algorithm specification {1, 3, 5} do not match z planes extracted from regular expression set()
This is the same regex recommended by VPT, I have used it in the non-forked version of VPT and it worked at the time. I also get the same error when I remove the dilation parameter from the .json file. I do not get the error with the same code and .json (without the dilation parameter) but in my other VPT venv. Do you have any ideas why that might be happening? I have not changed my image names, when I try the regex independently of the forked function, it seems fine. Thank you in advance for your help!
Hey there, In the context of segmentation of MERSCOPE data using a trained Cellpose 2.0 model with Vizgen's VPT plugin, I finally got around to trying the nuclear expansion method. I downloaded the fork (https://github.com/carsen-stringer/vizgen-postprocessing) into a venv and ran essentially the exact same code that I used prior to run my cellpose 2.0 model via VPT:
vpt --verbose run-segmentation ^ --segmentation-algorithm "cellpose2_CP_20241028_115219v4-expanded.json" ^ --input-images "images\mosaic(?P[\w|-]+)_z(?P[0-9]+).tif" ^
--input-micron-to-mosaic "images\micron_to_mosaic_pixel_transform.csv" ^
--output "analysis_outputs_customv5" ^
--tile-size 2400 ^
--tile-overlap 200
My only modification was in the .json file where I added a "dilation" = 2.0 line under segmentation parameters: cellpose2_CP_20241028_115219_v4_expanded.json
When I ran the code, I got the following error: File "C:\Users\marsdenl\~.venv\vpt-fork-env\lib\site-packages\vpt\prepare_segmentation\validate.py", line 14, in validate_regex_and_alg_match raise ValueError(f'Z planes from algorithm specification {alg_info.z_layers} do not match ' ValueError: Z planes from algorithm specification {1, 3, 5} do not match z planes extracted from regular expression set()
This is the same regex recommended by VPT, I have used it in the non-forked version of VPT and it worked at the time. I also get the same error when I remove the dilation parameter from the .json file. I do not get the error with the same code and .json (without the dilation parameter) but in my other VPT venv. Do you have any ideas why that might be happening? I have not changed my image names, when I try the regex independently of the forked function, it seems fine. Thank you in advance for your help!
Packages in venv:
absl-py==2.1.0 affine==2.4.0 aiobotocore==1.4.2 aiohappyeyeballs==2.4.3 aiohttp==3.11.7 aioitertools==0.12.0 aiosignal==1.3.1 astunparse==1.6.3 async-timeout==5.0.1 attrs==24.2.0 boto3==1.17.0 botocore==1.20.106 cachetools==5.5.0 cellpose==1.0.2 certifi==2024.8.30 cffi==1.17.1 charset-normalizer==3.4.0 click==8.1.7 click-plugins==1.1.1 cligj==0.7.2 cloudpickle==3.1.0 colorama==0.4.6 contourpy==1.2.1 csbdeep==0.8.1 cycler==0.12.1 dask==2022.9.0 decorator==5.1.1 distributed==2022.9.0 fastremap==1.15.0 filelock==3.16.1 fiona==1.10.1 flatbuffers==1.12 fonttools==4.55.0 frozenlist==1.5.0 fsspec==2021.10.0 gast==0.4.0 gcsfs==2021.10.0 geojson==2.5.0 geopandas==0.12.1 google-auth==2.36.0 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 grpcio==1.68.0 h5py==3.7.0 idna==3.10 imageio==2.36.0 Jinja2==3.1.4 jmespath==0.10.0 keras==2.9.0 Keras-Preprocessing==1.1.2 kiwisolver==1.4.7 libclang==18.1.1 llvmlite==0.43.0 locket==1.0.0 Markdown==3.7 MarkupSafe==3.0.2 matplotlib==3.8.4 mpmath==1.3.0 msgpack==1.1.0 multidict==6.1.0 natsort==8.4.0 networkx==3.4.2 numba==0.60.0 numpy==1.22.4 oauthlib==3.2.2 opencv-python-headless==4.6.0.66 opt_einsum==3.4.0 packaging==24.2 pandas==1.4.3 partd==1.4.2 pillow==11.0.0 propcache==0.2.0 protobuf==3.19.6 psutil==6.1.0 pyarrow==8.0.0 pyasn1==0.6.1 pyasn1_modules==0.4.1 pyclustering==0.10.1.2 pycparser==2.22 pyparsing==3.2.0 pyproj==3.7.0 python-dateutil==2.9.0.post0 python-dotenv==0.20.0 pytz==2024.2 pyvips==2.2.1 PyWavelets==1.6.0 PyYAML==6.0.2 rasterio==1.3.0 requests==2.32.3 requests-oauthlib==2.0.0 rsa==4.9 s3fs==2021.10.0 s3transfer==0.3.7 scikit-image==0.19.3 scipy==1.8.1 shapely==2.0.0 six==1.16.0 snuggs==1.4.7 sortedcontainers==2.4.0 stardist==0.8.3 sympy==1.13.1 tblib==3.0.0 tensorboard==2.9.1 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorflow==2.9.1 tensorflow-estimator==2.9.0 tensorflow-io-gcs-filesystem==0.31.0 termcolor==2.5.0 tifffile==2024.9.20 toolz==1.0.0 torch==2.5.1 tornado==6.1 tqdm==4.67.1 typing_extensions==4.12.2 urllib3==1.26.20 vpt @ file:///C:/Users/marsdenl/~/.venv/vizgen-postprocessing Werkzeug==3.1.3 wrapt==1.17.0 yarl==1.18.0 zict==3.0.0