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
05c86053
There was an error fetching the commit references. Please try again later.
Commit
05c86053
authored
8 years ago
by
Vladimír Ulman
Browse files
Options
Downloads
Patches
Plain Diff
Texture tuned very slightly. Let's add FF.
parent
a7a2ddba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmath3d/TriangleMesh.cpp
+12
-10
12 additions, 10 deletions
cmath3d/TriangleMesh.cpp
src/main.cpp
+3
-5
3 additions, 5 deletions
src/main.cpp
with
15 additions
and
15 deletions
cmath3d/TriangleMesh.cpp
+
12
−
10
View file @
05c86053
...
...
@@ -18,7 +18,7 @@
#undef max
//some debug-code enabling triggers
#define SAVE_INTERMEDIATE_IMAGES
//
#define SAVE_INTERMEDIATE_IMAGES
//'multiple' should be ideally 10^desired_decimal_accuracy
int
inline
RoundTo
(
const
float
val
,
const
float
multiple
=
1000.
f
)
...
...
@@ -881,13 +881,13 @@ void ActiveMesh::RenderOneTimeTexture(const i3d::Image3d<i3d::GRAY16>& mask,
perlinInner
.
CopyMetaData
(
mask
);
DoPerlin3D
(
perlinInner
,
5.0
,
0.8
*
1.5
,
0.7
*
1.5
,
6
);
#ifdef SAVE_INTERMEDIATE_IMAGES
perlinInner
.
SaveImage
(
"2_PerlinAlone_Inner.ics"
);
//
perlinInner.SaveImage("2_PerlinAlone_Inner.ics");
#endif
perlinOutside
.
CopyMetaData
(
mask
);
DoPerlin3D
(
perlinOutside
,
2.
,
0.8
*
1.5
,
0.7
*
1.5
,
6
);
#ifdef SAVE_INTERMEDIATE_IMAGES
perlinOutside
.
SaveImage
(
"2_PerlinAlone_Outside.ics"
);
//
perlinOutside.SaveImage("2_PerlinAlone_Outside.ics");
#endif
i3d
::
Image3d
<
i3d
::
GRAY16
>
erroded
;
...
...
@@ -906,7 +906,7 @@ void ActiveMesh::RenderOneTimeTexture(const i3d::Image3d<i3d::GRAY16>& mask,
{
//close to the surface?
if
(
*
p
<
0.3
f
||
*
er
==
0
)
*
p
=
2000.
f
+
5000.
f
*
(
*
pO
);
//corona
else
*
p
=
500.
f
+
8
00.
f
*
(
*
pI
);
//inside
else
*
p
=
500.
f
+
6
00.
f
*
(
*
pI
);
//inside
if
(
*
er
==
0
)
*
p
=
2000.
f
;
//std::max(*p,2000.f); //corona
if
(
*
p
<
0.
f
)
*
p
=
0.
f
;
...
...
@@ -986,6 +986,8 @@ void ActiveMesh::CenterMesh(const Vector3F& newCentre)
y
/=
double
(
Pos
.
size
());
z
/=
double
(
Pos
.
size
());
//std::cout << "mesh centre is: " << x << "," << y << "," << z << "\n";
x
-=
newCentre
.
x
;
y
-=
newCentre
.
y
;
z
-=
newCentre
.
z
;
...
...
@@ -1252,13 +1254,13 @@ void ActiveMesh::InitDots(const i3d::Image3d<i3d::GRAY16>& mask)
perlinInner
.
CopyMetaData
(
mask
);
DoPerlin3D
(
perlinInner
,
5.0
,
0.8
*
1.5
,
0.7
*
1.5
,
6
);
#ifdef SAVE_INTERMEDIATE_IMAGES
perlinInner
.
SaveImage
(
"2_PerlinAlone_Inner.ics"
);
//
perlinInner.SaveImage("2_PerlinAlone_Inner.ics");
#endif
perlinOutside
.
CopyMetaData
(
mask
);
DoPerlin3D
(
perlinOutside
,
2.
,
0.8
*
1.5
,
0.7
*
1.5
,
6
);
#ifdef SAVE_INTERMEDIATE_IMAGES
perlinOutside
.
SaveImage
(
"2_PerlinAlone_Outside.ics"
);
//
perlinOutside.SaveImage("2_PerlinAlone_Outside.ics");
#endif
i3d
::
Image3d
<
i3d
::
GRAY16
>
erroded
;
...
...
@@ -1277,7 +1279,7 @@ void ActiveMesh::InitDots(const i3d::Image3d<i3d::GRAY16>& mask)
{
//close to the surface?
if
(
*
p
<
0.3
f
||
*
er
==
0
)
*
p
=
2000.
f
+
5000.
f
*
(
*
pO
);
//corona
else
*
p
=
500.
f
+
8
00.
f
*
(
*
pI
);
//inside
else
*
p
=
500.
f
+
6
00.
f
*
(
*
pI
);
//inside
if
(
*
er
==
0
)
*
p
=
2000.
f
;
//std::max(*p,2000.f); //corona
if
(
*
p
<
0.
f
)
*
p
=
0.
f
;
...
...
@@ -1324,10 +1326,10 @@ void ActiveMesh::InitDots(const i3d::Image3d<i3d::GRAY16>& mask)
}
*/
}
#ifdef SAVE_INTERMEDIATE_IMAGES
//
#ifdef SAVE_INTERMEDIATE_IMAGES
std
::
cout
<<
"intiated "
<<
dots
.
size
()
<<
" fl. molecules (capacity is for "
<<
dots
.
capacity
()
<<
")
\n
"
;
#endif
//
#endif
}
...
...
@@ -1379,7 +1381,7 @@ void ActiveMesh::RenderDots(const i3d::Image3d<i3d::GRAY16>& mask,
const
int
z
=
(
int
)
roundf
(
(
dots
[
i
].
z
-
zOff
)
*
zRes
);
if
((
x
>
0
)
&&
(
y
>
0
)
&&
(
z
>
0
)
&&
(
x
<
maxX
)
&&
(
y
<
maxY
)
&&
(
z
<
maxZ
))
T
[
z
*
Slice
+
y
*
xLine
+
x
]
+=
(
i3d
::
GRAY16
)
50
;
&&
(
x
<
maxX
)
&&
(
y
<
maxY
)
&&
(
z
<
maxZ
))
T
[
z
*
Slice
+
y
*
xLine
+
x
]
+=
i3d
::
GRAY16
(
50
)
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
3
−
5
View file @
05c86053
...
...
@@ -34,8 +34,8 @@ int main(void)
std
::
cout
<<
"normals #: "
<<
mesh
.
norm
.
size
()
<<
"
\n
"
;
RenderMesh
(
i
);
//
RenderMesh(i+1);
//
RenderMesh(i+2);
RenderMesh
(
i
+
1
);
RenderMesh
(
i
+
2
);
}
/*
...
...
@@ -156,8 +156,7 @@ int RenderMesh(int fileNo)
//renders and resamples the texture
i3d
::
Image3d
<
i3d
::
GRAY16
>
texture
;
mesh
.
RenderOneTimeTexture
(
mask
,
texture
);
/*
//mesh.RenderOneTimeTexture(mask,texture);
if
(
mesh
.
DotsFirstRun
())
{
std
::
cout
<<
"rendering texture first run
\n
"
;
...
...
@@ -170,7 +169,6 @@ int RenderMesh(int fileNo)
}
std
::
cout
<<
"rendering texture #"
<<
fileNo
<<
"
\n
"
;
mesh
.
RenderDots
(
mask
,
texture
);
*/
std
::
cout
<<
"exporting texture #"
<<
fileNo
<<
"
\n
"
;
char
fileName
[
1024
];
...
...
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