Volume Rendering

[ (Fiji Is Just) ImageJ ]

I got a wonderful z-stack of images from Ilya, and here’s what I get on running Stk>3D Project…> and a brightest point projection with interpolation. I can possibly be getting the size of each slice wrong. From the metadata, the depth along z seems to be ‘-2’, and each pixel represents 0.91 um. However, I have scaled the whole image down so as to not end up with a ~250 MB gif.

Projections of stack

Coding it ourselves? [ python vtk ] [ OpenGL (visual studio) ]

PCL: running the first example!

[ Writing PCD data ] [ Using PCL in your own project ]

[ . or : or ->  ]

This is what the flow seems like:

C++ file -> setting up CMakeLists.txt for generating a makefile -> running make to get an executable -> execute!

Here’s the code copy pasted from the linked tutorial:

#include <pcl/io/pcd_io.h> // i/o
#include <pcl/point_types.h> // pointT structs</code>

// struct PointXYZ
// {
// float x;
// float y;
// float z;
// };

int main(int argc, char** argv)
{
pcl::PointCloud cloud; // creating a struct named PointCloud

//Filling in cloud data
cloud.width = 5;
cloud.height = 1;
cloud.is_dense = false;
cloud.points.resize (cloud.width * cloud.height);

for (size_t i = 0; i < cloud.points.size(); ++i)
{
cloud.points[i].x = 1024 * rand() / (RAND_MAX + 1.0f);
cloud.points[i].y = 1024 * rand() / (RAND_MAX + 1.0f);
cloud.points[i].z = 1024 * rand() / (RAND_MAX + 1.0f);
}

pcl::io::savePCDFileASCII("test_pcd.pcd", cloud);
std::cerr << "Saved " << points.size() << " data points to test_pcd.pcd" << std::endl;

for (size_t i = 0; i < cloud.points.size (); ++i)
std::cerr &lt;&lt; " " << points[i].x << points[i].y << " " << cloud.points[i].z << std::endl;
}

I haven’t setup OpenNI, so this is what cmake gives me:

$ cmake .
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- chrono
-- checking for module 'openni-dev'
-- package 'openni-dev' not found
-- Could NOT find openni (missing: OPENNI_LIBRARY OPENNI_INCLUDE_DIRS)
** WARNING ** io features related to openni will be disabled
-- checking for module 'openni2-dev'
-- package 'openni2-dev' not found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** io features related to openni2 will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- checking for module 'openni-dev'
-- package 'openni-dev' not found
-- Could NOT find openni (missing: OPENNI_LIBRARY OPENNI_INCLUDE_DIRS)
** WARNING ** visualization features related to openni will be disabled
-- checking for module 'openni2-dev'
-- package 'openni2-dev' not found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** visualization features related to openni2 will be disabled
-- checking for module 'openni-dev'
-- package 'openni-dev' not found
-- Could NOT find openni (missing: OPENNI_LIBRARY OPENNI_INCLUDE_DIRS)
** WARNING ** apps features related to openni will be disabled
-- looking for PCL_COMMON
-- looking for PCL_GEOMETRY
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- looking for PCL_KDTREE
-- looking for PCL_SEARCH
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_FEATURES
-- looking for PCL_SEGMENTATION
-- looking for PCL_VISUALIZATION
-- looking for PCL_SURFACE
-- looking for PCL_REGISTRATION
-- looking for PCL_KEYPOINTS
-- looking for PCL_TRACKING
-- looking for PCL_RECOGNITION
-- looking for PCL_APPS
-- Could NOT find PCL_APPS (missing: PCL_APPS_LIBRARY)
-- looking for PCL_CLOUD_COMPOSER
-- looking for PCL_MODELER
-- looking for PCL_POINT_CLOUD_EDITOR
-- looking for PCL_OUTOFCORE
-- looking for PCL_PEOPLE
-- Configuring done
-- Generating done
-- Build files have been written to: path-here

Screen Shot 2015-05-16 at 3.13.22 AM

Now to visualize this point cloud!

[ View3D.cpp ] [ vision course ]

I grabbed the single PCD viewer, and things workout, but I am having trouble exiting out of the visualizer window that comes up…

Homebrew-ing the Point Cloud Library, VTK would take time!

[ installation tutorial ]

Critical step, else pcl won’t show with brew options.

brew tap homebrew/science

On running brew doctor:

Screen Shot 2015-05-15 at 1.00.23 AM

Screen Shot 2015-05-15 at 1.00.44 AM

Anyway, VTK installation was seemingly not working. So, I tried installing VTK by itself before resuming pcl’s installation. The mistake I made here was to assume that VTK brewing was failing because it was taking more than a minute. Silly me:

Screen Shot 2015-05-14 at 11.38.02 PM

Still need to update Qt!

Screen Shot 2015-05-15 at 1.03.49 AM

This turned out to be pointless, because when I started brewing PCL again, it installed VTK again!

Screen Shot 2015-05-15 at 1.43.44 AM

Next, we’ll test it out with an example!