Code Monkey home page Code Monkey logo

Comments (5)

dlegland avatar dlegland commented on September 25, 2024

Hi,

Yes, the library currently uses the connectivity withj dimension corresponding to that of the input image.
I am not a big fan of providing too much choices for "low-level" operators; the design strategy is rather to build workflows / encapsulate into macros or more general plugins. Maybe you can build such a macro?

Anyway, a trick could be to allow 2D connectivities for 3D arrays. Regions in consecutive slices/frames would therefore have distinct labels. We can think about it.

from morpholibj.

agclark12 avatar agclark12 commented on September 25, 2024

Sure. I understand. I already have already written macros that do this for my work flows. I was just thinking about this while putting together a new work flow since there doesn't seem to be an easy way to do this for a time series aside from using a macro. I thought the output from a timeseries may be somewhat confusing for someone who is not so familiar with connected component analysis.

Maybe it could at least be included in the documentation that the image dimensionality is used for determining the connectivity. Otherwise, as you mention, an option to use 2D connectivity for 3D arrays would be a nice solution. Or, if the stack is a time series, it could use 2D connectivity, while if it is a z-series it could use 3D. I think that might make sense in terms of what people want out of this function considering their input data. Although, as one sometimes loses track of whether their slices are considered time or z-slices, it could also be confusing. I guess there is probably not an ideal solution for all users. Anyway, thanks! I use this package a lot!

from morpholibj.

iarganda avatar iarganda commented on September 25, 2024

I actually wrote some scripts to do that and I also wonder if it would be worth it for some plugins to include the "Apply to stack" option in 2D as in regular 2D filters in ImageJ...

from morpholibj.

dlegland avatar dlegland commented on September 25, 2024

Hmm, yes, for 2D processing, we could envision adding such an option! We can also add the option only in the case of a 3D input image.

from morpholibj.

agclark12 avatar agclark12 commented on September 25, 2024

Having such a standard "Apply to Stack" option would also make the scripting much easier because you can just iterate through the stack and run it on each slice instead of having to pull out slices one by one and make a new output stack. For anyone who stumbles on this thread and needs a way to do this in the macro, here is a small example to make this work for a stack where you only want 2D connectivity for each slice (e.g. time series):

//makes a new image with same dimensions as the original
rename("stk");
getDimensions(width, height, channels, slices, frames);
newImage("new", "8-bit", width, height, slices);

//cleans up segmentation for each frame
for (i=1;i<slices+1;i++) {

	selectWindow("stk");
	setSlice(i);
	run("Duplicate...", " ");
	rename("curr");
	run("Keep Largest Region");
	run("Fill Holes", "");
	run("Select All");
	run("Copy");
	selectWindow("new");
	setSlice(i);
	run("Paste");
	run("Select None");
	close("curr");
	close("curr-largest");
	
}

from morpholibj.

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.