DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
LongvolWriter.h
1
16
17
#pragma once
18
30
31
#if defined(LongvolWriter_RECURSES)
32
#error Recursive header files inclusion detected in LongvolWriter.h
33
#else
// defined(LongvolWriter_RECURSES)
35
#define LongvolWriter_RECURSES
36
37
#if !defined LongvolWriter_h
39
#define LongvolWriter_h
40
42
// Inclusions
43
#include <iostream>
44
#include <string>
45
#include "DGtal/base/Common.h"
46
#include "DGtal/base/CUnaryFunctor.h"
47
#include "DGtal/base/BasicFunctors.h"
49
50
namespace
DGtal
51
{
52
54
// template class LongvolWriter
68
template
<
typename
TImage,
typename
TFunctor = functors::Identity>
69
struct
LongvolWriter
70
{
71
// ----------------------- Standard services ------------------------------
72
73
typedef
TImage
Image
;
74
typedef
typename
TImage::Value
Value
;
75
typedef
TFunctor
Functor
;
76
typedef
DGtal::uint64_t
ValueLongvol
;
77
78
BOOST_CONCEPT_ASSERT
((
concepts::CUnaryFunctor<TFunctor, Value, ValueLongvol>
)) ;
79
80
91
static
bool
exportLongvol
(
const
std::string & filename,
const
Image
&aImage,
92
const
bool
compressed =
true
,
93
const
Functor
& aFunctor =
Functor
());
94
95
96
private
:
97
106
template
<
typename
Word>
107
static
108
std::ostream&
write_word
( std::ostream& outs, Word value )
109
{
110
for
(
unsigned
size =
sizeof
( Word ); size; --size, value >>= 8)
111
outs.put(
static_cast <
char
>
(value & 0xFF) );
112
return
outs;
113
}
114
115
};
116
}
//namespace
117
119
// Includes inline functions.
120
#include "DGtal/io/writers/LongvolWriter.ih"
121
122
// //
124
125
#endif
// !defined LongvolWriter_h
126
127
#undef LongvolWriter_RECURSES
128
#endif
// else defined(LongvolWriter_RECURSES)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::uint64_t
std::uint64_t uint64_t
unsigned 64-bit integer.
Definition
BasicTypes.h:64
DGtal::LongvolWriter
Aim: Export a 3D Image using the Longvol formats (volumetric image with DGtal::uint64_t value type).
Definition
LongvolWriter.h:70
DGtal::LongvolWriter::write_word
static std::ostream & write_word(std::ostream &outs, Word value)
Definition
LongvolWriter.h:108
DGtal::LongvolWriter::Value
TImage::Value Value
Definition
LongvolWriter.h:74
DGtal::LongvolWriter::Functor
TFunctor Functor
Definition
LongvolWriter.h:75
DGtal::LongvolWriter::exportLongvol
static bool exportLongvol(const std::string &filename, const Image &aImage, const bool compressed=true, const Functor &aFunctor=Functor())
DGtal::LongvolWriter::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, Value, ValueLongvol >))
DGtal::LongvolWriter::ValueLongvol
DGtal::uint64_t ValueLongvol
Definition
LongvolWriter.h:76
DGtal::LongvolWriter::Image
TImage Image
Definition
LongvolWriter.h:73
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition
CUnaryFunctor.h:90
src
DGtal
io
writers
LongvolWriter.h
Generated on
for DGtal by
1.18.0