Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 776643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:28:54+00:00 2026-05-14T19:28:54+00:00

I want to generate a binary mask that has ones for all voxels inside

  • 0

I want to generate a binary mask that has ones for all voxels inside and zeros for all voxels outside a volume. The volume is defined by the convex hull around a set of 3D coordinates (<100; some of the coordinates are inside the volume).

I can get the convex hull using CONVHULLN, but how do I convert that into a binary mask?

In case there is no good way to go via the convex hull, do you have any other idea how I could create the binary mask?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:28:54+00:00Added an answer on May 14, 2026 at 7:28 pm

    You can solve this problem using the DelaunayTri class and the pointLocation method. Here’s an example:

    pointMatrix = rand(20,3);       %# A set of 20 random 3-D points
    dt = DelaunayTri(pointMatrix);  %# Create a Delaunay triangulation
    [X,Y,Z] = meshgrid(0:0.01:1);   %# Create a mesh of coordinates for your volume
    simplexIndex = pointLocation(dt,X(:),Y(:),Z(:));  %# Find index of simplex that
                                                      %#   each point is inside
    mask = ~isnan(simplexIndex);    %# Points outside the convex hull have a
                                    %#   simplex index of NaN
    mask = reshape(mask,size(X));   %# Reshape the mask to 101-by-101-by-101
    

    The above example creates a logical mask for a 101-by-101-by-101 mesh spanning the unit volume (0 to 1 in each dimension), with a 1 (true) for the mesh points inside the convex hull of the 3-D point set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate a code on n bits for k different inputs that
I want to generate a 16-bit executable BINARY RAW format by Watcom C compiler
I have a 56 bit binary string that i want to use as the
My problem is, that I want to parse binary files of different types with
Let's say I have a class of 30 students and want generate every possible
I want to generate a list of files where the name consists of ${filename}.${date}
I want to generate a random timestamp and add a random increment to it
I want to generate random integers between 0-9 (inclusive on both ends), but I
I want to generate an HTML table from a couple specified parameters. Specifically, the
I want to generate 1M random (appearing) unique alphanumeric keys and store them in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.