4141#define SCI_Teem_NrrdData_h
4242
4343#include < Core/Datatypes/Datatype.h>
44- // #include <teem/nrrd .h>
45-
44+ #include < Core/GeometryPrimitives/GeomFwd .h>
45+ # include < teem/nrrd.h >
4646#include < Core/Datatypes/Legacy/Nrrd/share.h>
4747
4848namespace SCIRun {
4949
50- // ///////
51- // Structure to hold NrrdData
52- class SCISHARE NrrdData : public PropertyManager {
53- public:
54- // GROUP: public data
55- // ////////
56- //
57- Nrrd *nrrd_;
58-
50+ class SCISHARE NrrdData : public Core::Datatypes::Datatype
51+ {
52+ public:
5953 NrrdData ();
60- NrrdData (Nrrd *nrrd);
61- NrrdData (LockingHandle<Datatype> data_owner);
62- NrrdData (const NrrdData&);
54+ explicit NrrdData (struct Nrrd *nrrd);
55+ explicit NrrdData (const NrrdData&);
6356 virtual ~NrrdData ();
6457
65- virtual NrrdData* clone ();
58+ virtual NrrdData* clone () const override ;
6659
6760 virtual void io (Piostream&);
6861 static PersistentTypeID type_id;
@@ -72,11 +65,9 @@ class SCISHARE NrrdData : public PropertyManager {
7265 void set_embed_object (bool v) { embed_object_ = v; }
7366 bool get_embed_object () { return embed_object_; }
7467
75- void set_filename ( const std::string &f )
76- { nrrd_fname_ = f; embed_object_ = false ; }
77- const std::string get_filename () const { return nrrd_fname_; }
78-
79- bool write_nrrd_;
68+ // void set_filename( const std::string &f )
69+ // { nrrd_fname_ = f; embed_object_ = false; }
70+ // const std::string get_filename() const { return nrrd_fname_; }
8071
8172 // As parts of TEEM are by design not thread safe we need to enforce thread-safety
8273 // on certain functionality by forcing it to run single threaded.
@@ -86,24 +77,19 @@ class SCISHARE NrrdData : public PropertyManager {
8677 static void lock_teem ();
8778 static void unlock_teem ();
8879
89- protected:
80+ private:
81+ Nrrd *nrrd_;
82+ bool write_nrrd_;
9083 bool embed_object_;
9184
9285 bool in_name_set (const std::string &s) const ;
9386
94- // / Either the NrrdData owns the data or it wraps this external object.
95- LockingHandle<Datatype> data_owner_;
96-
9787 // To help with pio
98- std::string nrrd_fname_;
88+ std::string nrrd_fname_;
9989
10090 static Persistent *maker ();
10191};
10292
103-
104- typedef LockingHandle<NrrdData> NrrdDataHandle;
105-
106-
10793// nrrd Types that we need to convert to:
10894// nrrdTypeChar,
10995// nrrdTypeUChar,
@@ -151,7 +137,7 @@ template <>
151137SCISHARE int get_nrrd_type<float >();
152138
153139template <>
154- SCISHARE int get_nrrd_type<Tensor>();
140+ SCISHARE int get_nrrd_type<Core::Geometry:: Tensor>();
155141
156142template <class T >
157143int get_nrrd_type ()
@@ -166,15 +152,13 @@ SCISHARE void get_nrrd_compile_type( const unsigned int type,
166152SCISHARE double get_nrrd_value ( Nrrd* nrrd,
167153 unsigned int p );
168154
169-
155+ # ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
170156class SCISHARE NrrdGuard {
171157 public:
172- // Constructor
173158 NrrdGuard ();
174-
175- // Destructor
176159 ~NrrdGuard ();
177160};
161+ #endif
178162
179163
180164} // end namespace SCIRun
0 commit comments