//--------------------------------------------------------------------
//--------------------------------------------------------------------
-itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename) {
+itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, bool exit_on_error) {
itk::ImageIOBase::Pointer reader =
itk::ImageIOFactory::CreateImageIO(filename.c_str(), itk::ImageIOFactory::ReadMode);
- if (!reader) return NULL;
+ if (!reader) {
+ if (exit_on_error) //default behavior for tools who don't handle the problem
+ {
+ std::cerr << "Error reading file " << filename << ", exiting immediately" << std::endl;
+ std::exit(-1);
+ }
+ else
+ return NULL;
+ }
reader->SetFileName(filename);
reader->ReadImageInformation();
return reader;
//--------------------------------------------------------------------
// Read/print image header
- itk::ImageIOBase::Pointer readImageHeader(const std::string & filename);
+ itk::ImageIOBase::Pointer readImageHeader(const std::string & filename,bool exit_on_error=true);
void printImageHeader(itk::ImageIOBase::Pointer header, std::ostream & os, const int level=0);
//--------------------------------------------------------------------
#include "itkMatrix.h"
#include "itkArray.h"
#include "itkPoint.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
#include "clitkCommon.h"
=================================================*/
// clitk include
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
+#include <cstdlib>
//====================================================================
// Open a file for reading
//====================================================================
//====================================================================
-itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename) {
+itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, bool exit_on_error) {
itk::ImageIOBase::Pointer reader =
itk::ImageIOFactory::CreateImageIO(filename.c_str(), itk::ImageIOFactory::ReadMode);
- if (!reader) return NULL;
+ if (!reader)
+ if (exit_on_error) //default behavior for tools who don't handle the problem
+ {
+ std::cerr "Error reading file " << filename << ", exiting immediately" << std::endl;
+ std::exit(-1);
+ }
+ else
+ return NULL;
reader->SetFileName(filename);
reader->ReadImageInformation();
return reader;
cpus=$(( $(cat /proc/cpuinfo | grep -c ^processor) + 0 ))
fi
-make -j ${cpus} $@ &
-make_pid=$(jobs -p %make)
+nice -n12 ionice -c3 make -j ${cpus} $@ &
+make_pid=$(jobs -p %nice)
+
#watch memory use to avoid crashes
while ps $make_pid >>/dev/null
do
#define __clitkForwardWarpImageFilter_h
//clitk include
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
//itk include
#include "itkImageToImageFilter.h"
#define __clitkForwardWarpImageFilter_txx
#include "clitkForwardWarpImageFilter.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
// Put the helper classes in an anonymous namespace so that it is not
// exposed to the user
#define __clitkGenericInterpolator_h
//clitk include
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
//itk include
#include "itkNearestNeighborInterpolateImageFunction.h"
#define __clitkGenericVectorInterpolator_h
//clitk include
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
//itk include
#include "itkVectorNearestNeighborInterpolateImageFunction.h"
#define __clitkInvertVFFilter_h
//clitk include
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
#include "itkImageToImageFilter.h"
#include "itkImage.h"
#include "clitkSignalFilter_ggo.h"
#include "clitkSignal.h"
#include "clitkIO.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
int main(int argc, char * argv[]) {
#include "clitkSignalMeanPositionTracking_ggo.h"
#include "clitkSignalMeanPositionFilter.h"
#include "clitkIO.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
int main(int argc, char * argv[]) {
// clitk include
#include "clitkVFMerge_ggo.h"
#include "clitkIO.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
// itk include
//#include "itkReadTransform.h"
// clitk include
#include "clitkZeroVF_ggo.h"
#include "clitkIO.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
#include "clitkZeroVFGenericFilter.h"
int main( int argc, char *argv[] )
#define __clitkZeroVFGenericFilter_h
//clitk include
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
#include "clitkImageCommon.h"
//itk include
Program: vv
Module: $RCSfile: vvMainWindow.cxx,v $
Language: C++
- Date: $Date: 2010/02/07 12:00:59 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2010/02/09 10:28:07 $
+ Version: $Revision: 1.10 $
Author : Pierre Seroul (pierre.seroul@gmail.com)
Copyright (C) 200COLUMN_IMAGE_NAME
#include "vvProgressDialog.h"
#include "vvQDicomSeriesSelector.h"
#include "vvSlicerManager.h"
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
#include "vvSlicer.h"
#include "vvInteractorStyleNavigator.h"
#include "vvImageWriter.h"
#ifndef VVQPROGRESSDIALOGITKCOMMAND_CXX
#define VVQPROGRESSDIALOGITKCOMMAND_CXX
-#include "clitkIOCommon.h"
+#include "clitkImageCommon.h"
#include "vvQProgressDialogITKCommand.h"
//====================================================================