Skip to content
Snippets Groups Projects
Commit 96cb7e2b authored by Boris Sedji's avatar Boris Sedji
Browse files

No commit message

No commit message
parent e885723d
No related branches found
No related tags found
No related merge requests found
# pour boris:
add_executable(boris EXCLUDE_FROM_ALL contrib/arc/boris.cpp ${GMSH_SRC})
target_link_libraries(boris ${LINK_LIBRARIES})
include(/home/boris/MyGmshProjects/CMakeLists.txt)
# tests pour eric et christophe:
list(APPEND EXTERNAL_INCLUDES contrib/arc)
add_executable(elastic EXCLUDE_FROM_ALL contrib/arc/mainElasticity.cpp ${GMSH_SRC})
......
#include <stdio.h>
#include "Gmsh.h"
#include "GModel.h"
#include "MElement.h"
#include "gmshLevelset.h"
int main(int argc, char **argv)
#include "itkCurvatureAnisotropicDiffusionImageFilter.h"
#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
#include "itkSigmoidImageFilter.h"
#include "itkImage.h"
#include "itkFastMarchingImageFilter.h"
#include "itkBinaryThresholdImageFilter.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkRescaleIntensityImageFilter.h"
int main( int argc, char *argv[] )
{
GmshInitialize(argc, argv);
GModel *m = new GModel();
m->readMSH("toto.msh");
double a(1.), b(0.), c(0.), d(-0.05);
int n(1);
gLevelset *ls = new gLevelsetPlane(a, b, c, d, n);
GModel *m2 = m->buildCutGModel(ls);
m2->writeMSH("toto2.msh", 2.1, false, true);
delete m;
GmshFinalize();
}
if( argc < 8 )
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr << " inputImage xi xf yi yf zi zf"<< std::endl;
return 1;
}
typedef float PixelTypeFloat;
const unsigned int Dimension = 3;
typedef itk::Image< PixelTypeFloat, Dimension > ImageTypeFloat;
typedef itk::ImageFileReader< ImageTypeFloat > ImageReaderTypeFloat;
ImageReaderTypeFloat::Pointer reader = ImageReaderTypeFloat::New();
reader->SetFileName(argv[1]);
ImageTypeFloat::Pointer image = reader->GetOutput();
image->Update();
PixelTypeFloat pixelValue;
ImageTypeFloat::IndexType pixelIndex;
ImageTypeFloat::RegionType region;
region = image->GetLargestPossibleRegion ();
std::cout<<"GetImageDimensionX() :" << region.GetSize(0) << "\n" ;
std::cout<<"GetImageDimensionY() :" << region.GetSize(1) << "\n" ;
std::cout<<"GetImageDimensionZ() :" << region.GetSize(2) << "\n" ;
std::cout<<"\nStart loops...\n" ;
for (int k = atoi(argv[6]);k<atoi(argv[7]);k++){
for (int i = atoi(argv[2]);i<atoi(argv[3]);i++){
for (int j = atoi(argv[4]);j<atoi(argv[5]);j++){
pixelIndex[0] = i; // x position
pixelIndex[1] = j; // y position
pixelIndex[2] = k; // y position
pixelValue = image->GetPixel( pixelIndex );
std::cout<< " " << pixelValue << " " ;
}
std::cout<< "\n" ;
}
std::cout<< "\n\n\n\n" ;
}
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment