/*=========================================================================
 This file is part of the Horos Project (www.horosproject.org)
 
 Horos is free software: you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation,  version 3 of the License.
 
 The Horos Project was based originally upon the OsiriX Project which at the time of
 the code fork was licensed as a LGPL project.  However, not all of the the source-code
 was properly documented and file headers were not all updated with the appropriate
 license terms. The Horos Project, originally was licensed under the  GNU GPL license.
 However, contributors to the software since that time have agreed to modify the license
 to the GNU LGPL in order to be conform to the changes previously made to the
 OsirX project.
 
 Horos is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE OR USE.  See the
 GNU Lesser General Public License for more details.
 
 You should have received a copy of the GNU Lesser General Public License
 along with Horos.  If not, see http://www.gnu.org/licenses/lgpl.html
 
 Prior versions of this file were published by the OsiriX team pursuant to
 the below notice and licensing protocol.
=========================================================================
  Program:   OsiriX

  Copyright (c) OsiriX Team
  All rights reserved.
  Distributed under GNU - GPL
  
  See http://www.osirix-viewer.com/copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.
=========================================================================*/



#import <Cocoa/Cocoa.h>


#define id Id
#include "vtkPolyData.h"
#undef id


@class OSIVoxel;
@class WaitRendering;


/** \brief Extracts an array of centerline points from  marching cubes filtered Polydata
*
*  Centerline extracts the centerline from a volume using thinning
*  Based on Iordanescu and Summers
*  Automated Centerline for CT Colonography
*  Academic Radiology Vol 10 No 11 Nov 2003 pp1291-1301
*
*
*  Has properties:
*  WaitRendering *wait;
*  OSIVoxel *startingPoint
*  OSIVoxel *endingPoint
*  int thinningIterations
*/


@interface Centerline : NSObject {
	WaitRendering *_wait;
	OSIVoxel *_startingPoint;
	OSIVoxel *_endingPoint;
	int _thinningIterations;

}

@property (readwrite, retain) WaitRendering *wait;
@property (readwrite, retain) OSIVoxel *startingPoint;
@property (readwrite, retain) OSIVoxel *endingPoint;
@property int thinningIterations;

+ (id)centerline;
/// Creates the centerline from a marchingCubes created polygon.
- (NSArray *)generateCenterline:(vtkPolyData *)polyData startingPoint:(OSIVoxel *)start endingPoint:(OSIVoxel *)end;
///Creates a set of all neighbors
- (NSMutableSet *)connectedPointsForPoint:(vtkIdType)pt fromPolyData:(vtkPolyData *)data;

@end
