Tag Info

Hot answers tagged

32

Introduction I propose a solution to this object separation problem, which simply was inspired by one of the application examples of DistanceTransform. It uses a simple method to split virtually connected (blurred) objects in 3D. A LoG filter (Marr-Hildreth operator) is detecting edges in the Euclidean distance transform by this doing a tesselation required ...


14

MyImagePartition In the meantime, before Mathematica 10 will come out, you can enjoy my on-foot solution MyImagePartition, which both saves memory and time using the PartitionMap function from the Developer context: MyImagePartition[im_, wh_, dwdh_List: {0, 0, 0}] := Module[{it = ImageType@im, cs = First@Options[im, ColorSpace], il = ...


13

body[t_] = Integrate[#[u^2], {u, 0, t}] & /@ {Cos, Sin} ParametricPlot3D[body[t]~Join~{t}, {t, -2 Pi, 2 Pi}, BoxRatios -> 1, SphericalRegion -> True]


13

This is not a direct answer to your question but it can help you. I see your question is about adaptive thresholding. I propose finding threshold values without exact partitioning. img = Import["http://homepages.inf.ed.ac.uk/rbf/HIPR2/images/son1.gif"] The simplest is GaussianFilter which is analog to $T = mean$ in your link. GF = GaussianFilter[img, ...


10

I'm a consultant at Wolfram Research. It is a bug which will be fixed in Mathematica 10. Here is a workaround for Mathematica 9.0.1: Image3D[ListDeconvolve[GaussianMatrix[{{1, 1, 1}, 1}], ImageData[img3d], Method -> {"RichardsonLucy", "Preconditioned" -> True}, MaxIterations -> 16]]


10

According to the documentation of Image3D, "an interactive color function editor is available via the Image3D contextual (right-click) menu". (And yes! I only found it after reading your question!) And you can get the explicit function by clicking the "Copy Function" button. Blend[{ {0., RGBColor[0.05635, 0.081, 0.07687, 0.00343663]}, ...


9

I post this as for this particular "puzzle" there is a straightforward approach. However, as has been commented some evidence of attempt is the norm. triang[x_, y_] := {{x, 0, 1}, {x, -y, 0}, {x, y, 0}} Now visualizing for this particular isoceles triangle. Graphics3D[{Polygon[ Table[triang[j, Sqrt[1 - j^2]], {j, -1, 1, 0.005}]], ...


7

Let's say we have the following 3 shapes. An isosceles triangle with base and height $(b, h)$ centered at $(x_0,z_0)$, The shape is given by 3 equations: $$z > z_0- h/2$$ $$ z < 2 h /b (x- (x_0-b/2)) +(z_0 -h/2) $$ $$ z < -( 2 h /b (x- (x_0-b/2))) -2 h -(z_0 -h/2) $$ with a rectangle with width and height set by the triangle $(b,h)$ and ...


7

In Mathematica 9, ImagePartition uses ImageData and Partition so it is slow and requires a lot of memory. This issue will be fixed in Mathematica 10.


6

If you already have a Graphics3D object, then you can recreate an Image3D object by stacking slices of your graphics along an axis. Here's an example. We start with your object: obj = Plot3D[x^2 - y^2, {x, -1, 1}, {y, -1, 1}] Using the following rudimentary "slice" function, we can generate slices of the function at a given value of $x$: slice[obj_, ...


5

Image3D is buggy, doesn't have all the options that other Graphics3D objects have, but we can work with it. The strategy here is to change the tickmarks in an empty ContourPlot3D and then use Show to combine it with the Image3D. Of course, you can edit the tickmarks manually but I like to use the CustomTicks package, available here: ...


5

Firstly, you need to apply {50,50,50} shift to DiskMatrix. It is because DiskMatrix produces sphere with the center at {50,50,50}. Image3D has different axes directions than Graphics3D so you need to search through numerous variants of transpositions and reflections. I found the following combination: z = 10; p = RandomInteger[100, {z, 3}]; r = ...


3

In this approach the main idea is to pre-process the images rather than processing 3D Image. Lets look at some properties of the images. im = Import["...\\smallExample.tif"] (*Resize it for speeding up the process*) img = ImageResize[#, 50] & /@ im; Lets look at image 20 (others are similar) to see it's histogram. 0-0.05 shows us the Black ...


2

Here is something quick and dirty to convert from a Graphics3D to Image3D (the second argument is sort of a quality knob, the higher the number the more slices are taken): img3Dify[gr3d_Graphics3D, qu_] := Module[{pr, br, slices}, pr = PlotRange /. AbsoluteOptions[gr3d, PlotRange]; br = Map[Norm@Differences[#] &, pr]; slices = ParallelMap[ ...


2

Here's a way to do the adaptive thresholding using the built-in ImageFilter function. To apply this to the "Sonnet for Lena" as in ybeltukov's answer, define an auxiliary function that does the local thresholding: adaptThresh[x_, threshRat_] := Module[{center, thisPix}, center = (First[Dimensions[x]] + 1)/2; thisPix = x[[center, center]]; ...


2

Using Raster3D : Graphics3D[{Opacity[.5],Raster3D[RandomReal[1,{5,5,5,3}]]}, Axes-> True] This will generate unit voxels, while the following creates 5x5x5 unit voxels: Graphics3D[{Opacity[.5],Raster3D[RandomReal[1,{5,5,5,3}],{{0,0,0},{25,25,25}}]}, Axes-> True] Perhaps this will clarify the sizes: Show[{ ...


2

Another way to get pseudo-voxels using Cuboid (mainly for versions <9): {dx, dy, dz} = {5, 5, 5}; Graphics3D[ Table[{EdgeForm[], Opacity[.1], Hue[Sqrt[x^2 + y^2 + z^2]/25], Cuboid[{x, y, z} - {dx, dy, dz}/2, {x, y, z} + {dx, dy, dz}/ 2]}, {x, -25, 25, dx}, {y, -25, 25, dy}, {z, -25, 25, dz}]] or using other increments: ... and just to ...


1

Here is the code for Plotting voxel grid: PlottingVoxel[{VoxCenter_, VoxH_, VoxL_, VoxP_}] := Module[{Ip, CoordVox}, ( Ip = VoxCenter - N[{VoxH/2, VoxL/2, VoxP/2}]; CoordVox = {{Ip, Ip + {VoxH, 0, 0}, Ip + {VoxH, VoxP, 0}, Ip + {0, VoxP, 0}}, {Ip, Ip + {VoxH, 0, 0}, Ip + {VoxH, 0, VoxL}, Ip + {0, 0, VoxL}}, {Ip + {0, 0, VoxL}, Ip + ...


1

This may not answer your question. I don't quite understand how you built the Image3D object. I notice that the sphere doesn't seem to go where you put the points. For example, if I put the point right in the middle of the coordinate system, they end up out at the corners p = {{50, 50, 50}}; r = {10}; spheres = MapThread[RotateLeft[DiskMatrix[#1, ...


1

This still may be considered a duplicate, but it's also possible that there is something odd happening with the formation of spheres. A set of geometric transformations (rotations, reflections and finally a scaling) gives close to overlap. Note I got rid of the randomness to make this problem a bit easier to navigate and did not nest the ...



Only top voted, non community-wiki answers of a minimum length are eligible