Since the subject-specific CT scans belong to real patients, I couldn't export that data, as well as the commercial template skull mesh bought from Zygote.

I still share my code though, with the highlights on the important functions. Hope it helps/accelerates your development.

/////////// preprocessing of CT scans ////////////////////
CT scans generally come in DICOM format. Here is how I convert them to nii format, a format that my C++ code can work with
+convert input DICOM files into NIfTI (nii) format using the dcm2nii.exe software on the Web:
++ E:\Postdoc\skull\mricron>dcm2nii.exe ..\CTsample\DICOM\4821\4823
++ unzip 20130118_0933183DHEADs002a002.nii.gz

+learn skull/bone intensities
++ download and launch ITK-SNAP
+++ Open Greyscale Image -> Browse to \4821\4823\20130118_0933183DHEADs002a002.nii
+++ move cursor around skull, i.e. exterior part, and read intensities, generally in [200, 1000] for the skull bones


/////////// C++ code highlights ////////////////////
VoxelSet.cpp: Set of voxels forming the input CT scan
	VoxelSet::loadNii: create grid of skull voxels

Mesh.cpp: The generic template tetrahedral mesh to be deformed towards the VoxelSet
	Mesh::loadTet: load tetmesh (to create tetmesh from triangular mesh, I've used Winding Numbers of Jacobson et al. (downloaded a Matlab implementation)
	Mesh::initialAlignment: apply standard PCA alignment (in Mesh::poseNormalization) and then our adaptive-scaling ICP (in Mesh::ICP) to perform the initial global rigid alignment b/w this Mesh and VoxelSet
	Mesh::computeLaplacian(): create Laplacian of this tetmesh (note that you can use this Laplacian in any other deformation-related algorithm/code
	Mesh::deform(): establish closest point correspondences (kdtree::kd_nearest3f) as the point constraints and solve the deformation as a linear system (Eigen::SimplicialCholesky)

Please cite if you find the code useful or find the paper related:
Yusuf Sahillioglu, Skuller: A Volumetric Shape Registration Algorithm for Modeling Skull Deformities, Medical Image Analysis, 2014.



--ysf
