Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ISBI2016-filaSimu-TM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vladimír Ulman
ISBI2016-filaSimu-TM
Commits
4bf75ea4
There was an error fetching the commit references. Please try again later.
Commit
4bf75ea4
authored
8 years ago
by
Vladimír Ulman
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+13
-34
13 additions, 34 deletions
src/main.cpp
with
13 additions
and
34 deletions
src/main.cpp
+
13
−
34
View file @
4bf75ea4
...
...
@@ -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.6
f
,
1.6
f
,
1.3
f
));
mesh
.
TranslateMesh
(
Vector3F
(
-
8.0
f
,
-
8.0
f
,
-
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.5
f
,
27.5
f
,
22.0
f
);
//for sample cell
params
.
sceneCentre
=
params
.
sceneSize
;
params
.
sceneCentre
/=
2.0
f
;
...
...
@@ -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
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment