bool SpleenIdentifier3D::is_candidate(const PFNodeID& node, const BranchProperties& properties) const { itk::Index<3> volumeSize = ITKImageUtil::make_index_from_size(dicom_volume()->size()); int sliceCount = properties.z_max() + 1 - properties.z_min(); int minVoxelsPerSlice = 1000; int maxVoxelsPerSlice = 7000; return node.layer() == 1 && // it must be in the lowest branch layer 140 <= properties.mean_grey_value() && properties.mean_grey_value() <= 170 && // it must have a reasonable grey value properties.x_max() >= volumeSize[0]*0.8 && // it must stretch sufficiently far to the right properties.voxel_count() >= minVoxelsPerSlice * sliceCount && // it must be of a reasonable size properties.voxel_count() <= maxVoxelsPerSlice * sliceCount; }
bool SpineIdentifier3D::is_spine(const PFNodeID& node, const BranchProperties& properties) const { itk::Index<3> volumeSize = ITKImageUtil::make_index_from_size(dicom_volume()->size()); int minVoxels = MIN_VOXELS_PER_SLICE * volumeSize[2]; int maxVoxels = MAX_VOXELS_PER_SLICE * volumeSize[2]; double aspectRatioXY = properties.aspect_ratio_xy(); return properties.x_min() < volumeSize[0]/2 && properties.x_max() > volumeSize[0]/2 && // it should straddle x = volumeSize[0] / 2 properties.centroid().y > volumeSize[1]/2 && // its centroid should be below y = volumeSize[1]/2 properties.z_min() == 0 && properties.z_max() == volumeSize[2]-1 && // it should extend through all the slices we're looking at MIN_ASPECT_RATIO_XY <= aspectRatioXY && aspectRatioXY <= MAX_ASPECT_RATIO_XY && // it should have a reasonable x-y aspect ratio properties.mean_grey_value() >= MIN_MEAN_GREY_VALUE && // it should have a reasonably high grey value properties.voxel_count() >= minVoxels && properties.voxel_count() <= maxVoxels; // and a reasonable size }