Closed RylanSchaeffer closed 12 months ago
Hi Rylan,
process
is just a stand in for anything you'd like to do with the image.
Closing due to inactivity. Please reopen if you need more help!
Can you say more on this please: "process is just a stand in for anything you'd like to do with the image."
I am completely new to your library but I have some experience in Python.
I am trying to create objects from rainfall netCDF files, but I want to begin learning something very basic.
Is there some sample code of something simple which I can follow to learn the library.
I have not been able to find more documentation or examples elsewhere but it is important for me to learn this for my research.
Hi! The first step is you will need to convert netCDF files into numpy arrays. I'm not familiar with netCDF but here's the first google result:
https://towardsdatascience.com/read-netcdf-data-with-python-901f7ff61648
After that you run cc3d to extract the connected components. If you have a 2D image, select connectivity 4 or 8. If you have a 3D image, 6, 18, or 26 connectivity.
import cc3d
import numpy as np
labels = ... # numpy array extracted from netCDF
connectivity = ... # pick a connectivity
cc_labels, N = cc3d.connected_components(labels, connectivity=connectivity, return_N=True)
Then if you want to collect some basic statistics on the image:
stats = cc3d.statistics(cc_labels)
If you want to process individual binary images:
for label, image in cc3d.each(cc_labels, binary=True):
# whatever you want to do with image
I think a good starting point will be to have this 2D array based on a single timestep from the netCDF file.
I believe after this I can create a 3D array based on multiple timesteps from the netCDF file.
I am trying to identify rainfall as objects so I do not believe the binary classification is the better option.
I am at the beginning of my MSc research so I think I will be in touch as I progress.
Thank you for the information and your time.
Good luck with your research, don't hesitate to reach out!
On Sat, Nov 12, 2022, 12:09 PM OPersaud @.***> wrote:
Thank you for the information. I think a good starting point will be to have this 2D array based on a single timestep from the netCDF file.
I believe after this I can create a 3D array based on multiple timesteps from the netCDF file.
I am trying to identify rainfall as objects so I do not believe the binary classification is the better option.
I am at the beginning of my MSc research so I think I will be in touch as I progress.
Thank you for the information and your time.
— Reply to this email directly, view it on GitHub https://github.com/seung-lab/connected-components-3d/issues/72#issuecomment-1312529564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATGQSMVO6FUFUHYZY37IHTWH7FLVANCNFSM5C6P6TLA . You are receiving this because you modified the open/close state.Message ID: @.***>
The README.md file says to call the
process
function:What is this process function? I can't find it in default python or in cc3d.