Skip to content

Instantly share code, notes, and snippets.

@kmader
Last active October 26, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmader/b25ac8b94b600918b372 to your computer and use it in GitHub Desktop.
Save kmader/b25ac8b94b600918b372 to your computer and use it in GitHub Desktop.
3D Printing Instructions to make an STL file for 3D printers
  • First you need a thresholded version of the image to start processing
  • Next clean up the image a bit, for the bone image a 2x Opening was sufficient but some images require more. Then select the largest single component (you cannot have disconnected structures)
run("Erode (3D)", "iso=255");
run("Erode (3D)", "iso=255");
run("Dilate (3D)", "iso=255");
run("Dilate (3D)", "iso=255");

run("Find Connected Regions", "allow_diagonal display_image_for_each display_one_image display_results regions_for_values_over=100 minimum_number_of_points=5000 stop_after=-1");
  • Select the largest window
selectWindow("Region of value 255 containing 6340372 points");
run("Gaussian Blur...", "sigma=2.50 stack");
run("3D Viewer");
  • Select Display as: Surface
  • Select downsampling of 1 (2 makes some of the surfaces disappear)
  • Select a threshold of around 100 (large makes it thinner, smaller makes it thicker)
  • Export Surfaces -> STL (binary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment