Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
7152b670
Commit
7152b670
authored
Jul 17, 2013
by
Thery Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add import vtk
parent
71e149b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
include/Algo/MC/image.h
include/Algo/MC/image.h
+1
-0
include/Algo/MC/image.hpp
include/Algo/MC/image.hpp
+57
-0
No files found.
include/Algo/MC/image.h
View file @
7152b670
...
...
@@ -168,6 +168,7 @@ public:
*/
bool
loadInrgz
(
const
char
*
filename
);
bool
loadVTK
(
const
char
*
filename
);
/**
* Constructor
* @param data pointer on voxel
...
...
include/Algo/MC/image.hpp
View file @
7152b670
...
...
@@ -282,6 +282,63 @@ void Image<DataType>::saveInrMask(const char* filename)
#endif
template
<
typename
DataType
>
bool
Image
<
DataType
>::
loadVTK
(
const
char
*
filename
)
{
std
::
ifstream
in
(
filename
,
std
::
ios
::
binary
);
if
(
!
in
)
{
CGoGNerr
<<
"Mesh_Base::loadVox: Unable to open file "
<<
CGoGNendl
;
exit
(
0
);
}
m_SX
=
1.0
;
m_SY
=
1.0
;
m_SZ
=
1.0
;
// read encoding
// while(in.good())
for
(
unsigned
int
i
=
0
;
i
<
10
;
++
i
)
{
char
line
[
1024
]
;
in
.
getline
(
line
,
1024
)
;
std
::
istringstream
line_input
(
line
)
;
std
::
string
keyword
;
line_input
>>
keyword
;
if
(
keyword
==
"VTK"
)
{
std
::
cout
<<
"reading vtk file"
<<
std
::
endl
;
}
else
if
(
keyword
==
"DIMENSIONS"
)
{
line_input
>>
m_WX
;
line_input
>>
m_WY
;
line_input
>>
m_WZ
;
}
else
if
(
keyword
==
"SPACING"
)
{
line_input
>>
m_SX
;
line_input
>>
m_SY
;
line_input
>>
m_SZ
;
}
/*else if(keyword == "ORIGIN")
{
} else if(keyword == "POINT_DATA")
{
} */
}
m_WXY
=
m_WX
*
m_WY
;
int
total
=
m_WXY
*
m_WZ
;
m_Data
=
new
DataType
[
total
];
in
.
read
(
reinterpret_cast
<
char
*>
(
m_Data
),
total
*
sizeof
(
DataType
));
m_Alloc
=
true
;
}
template
<
typename
DataType
>
bool
Image
<
DataType
>::
loadIPB
(
const
char
*
filename
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment