GithubHelp home page GithubHelp logo

Comments (6)

william-silversmith avatar william-silversmith commented on July 22, 2024

Hi Rylan,

process is just a stand in for anything you'd like to do with the image.

from connected-components-3d.

william-silversmith avatar william-silversmith commented on July 22, 2024

Closing due to inactivity. Please reopen if you need more help!

from connected-components-3d.

OPersaud avatar OPersaud commented on July 22, 2024

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.

from connected-components-3d.

william-silversmith avatar william-silversmith commented on July 22, 2024

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

from connected-components-3d.

OPersaud avatar OPersaud commented on July 22, 2024

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.

from connected-components-3d.

william-silversmith avatar william-silversmith commented on July 22, 2024

from connected-components-3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.