Skip to content
Snippets Groups Projects
Commit 4bf75ea4 authored by Vladimír Ulman's avatar Vladimír Ulman
Browse files

Adjusted scene and cell position (no automatic shifts!) to fit the real data.

parent 95319075
No related branches found
No related tags found
No related merge requests found
......@@ -17,43 +17,21 @@ int main(void)
{
ParamsSetup();
//SURFACE FITTING:
//char filename[]="../sample_input/samplecell.stl";
char filename[]="../sample_input/torus_100_30.stl";
//char filename[]="../sample_input/sphere.stl";
int retval=mesh.ImportSTL(filename);
if (retval)
{
std::cout << "some error reading file: " << retval << "\n";
return(1);
}
std::cout << "mesh: " << filename << "\n";
std::cout << "vertices #: " << mesh.Pos.size() << "\n";
std::cout << "triangles #: " << mesh.ID.size()/3 << "\n";
std::cout << "normals #: " << mesh.norm.size() << "\n";
mesh.CenterMesh(params.sceneCentre);
//std::cout << "export retval=" << mesh.ExportSTL("/home/ulman/DATA/test.stl") << "\n";
/*
//work with mesh
float surf_coeff[10];
mesh.CalcQuadricSurface_Taubin(10,surf_coeff);
*/
/*
//ISBI:
//for (int i=0; i < 50; ++i)
for (int i=10; i < 11; ++i)
{
LoadNewMesh(i);
mesh.ScaleMesh(Vector3F(1.6f,1.6f,1.3f));
mesh.TranslateMesh(Vector3F(-8.0f,-8.0f,-4.f));
std::cout << "mesh: #" << i << "\n";
std::cout << "vertices #: " << mesh.Pos.size() << "\n";
std::cout << "triangles #: " << mesh.ID.size()/3 << "\n";
std::cout << "normals #: " << mesh.norm.size() << "\n";
RenderMesh(i);
}
*/
initializeGL();
loopGL();
......@@ -67,8 +45,7 @@ void ParamsSetup(void)
{
//set up the environment
params.sceneOffset=Vector3d<float>(0.f);
params.sceneSize=Vector3d<float>(15.f,15.f,15.f); //for torus
//params.sceneSize=Vector3d<float>(150.f,150.f,150.f); //for sample cell
params.sceneSize=Vector3d<float>(27.5f,27.5f,22.0f); //for sample cell
params.sceneCentre=params.sceneSize;
params.sceneCentre/=2.0f;
......@@ -151,8 +128,8 @@ int RenderMesh(int fileNo)
{
i3d::Image3d<i3d::GRAY16> mask;
mask.SetOffset(i3d::Offset(0.0,0.0,0.0));
mask.SetResolution(i3d::Resolution(20.0,20.0,20.0)); //for sample cell
mask.MakeRoom(300,300,300);
mask.SetResolution(i3d::Resolution(8.0,8.0,1.0)); //for sample cell
mask.MakeRoom(220,220,22);
mask.GetVoxelData()=0;
mesh.RenderMask(mask);
......@@ -161,11 +138,13 @@ int RenderMesh(int fileNo)
mask.SaveImage(fileName);
std::cout << "rendered mesh #" << fileNo << "\n";
/*
i3d::Image3d<i3d::GRAY16> texture;
mesh.RenderOneTimeTexture(mask,texture);
sprintf(fileName,"text_t%03d.tif",fileNo);
texture.SaveImage(fileName);
std::cout << "textured mesh #" << fileNo << "\n";
*/
return(0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment