2626 DEALINGS IN THE SOFTWARE.
2727*/
2828
29- #include < Core/ImportExport/Matrix/MatrixIEPlugin.h>
30- #include < Core/ImportExport/Field/FieldIEPlugin.h>
31- #include < Core/ImportExport/Nrrd/NrrdIEPlugin.h>
29+ #include < Core/IEPlugin/MatlabFiles_Plugin.h>
3230#include < Core/Matlab/matlabfile.h>
3331#include < Core/Matlab/matlabarray.h>
3432#include < Core/Matlab/matlabconverter.h>
35-
33+ #include < Core/Datatypes/Matrix.h>
34+ #include < Core/Datatypes/Legacy/Field/Field.h>
35+ #include < Core/Datatypes/Legacy/Nrrd/NrrdData.h>
36+ #include < Core/Datatypes/Legacy/Base/PropertyManager.h>
3637
3738// This file contains plugins to read and write files in MathWork's Matlab
3839// file format.
3940
40-
41- namespace SCIRun {
42-
43- using namespace MatlabIO ;
41+ using namespace SCIRun ;
42+ using namespace SCIRun ::MatlabIO ;
43+ using namespace SCIRun ::Core::Logging ;
44+ using namespace SCIRun ::Core::Datatypes ;
4445
4546// Write a matrix as matlab object
4647MatrixHandle
47- MatlabMatrix_reader (ProgressReporter * pr, const char *filename)
48+ SCIRun:: MatlabMatrix_reader (LoggerHandle pr, const char *filename)
4849{
4950 // Create a matlab file object, which will be linked to input file
5051 matlabfile mf;
@@ -90,7 +91,7 @@ MatlabMatrix_reader(ProgressReporter *pr, const char *filename)
9091}
9192
9293bool
93- MatlabMatrix_writer (ProgressReporter * pr,
94+ SCIRun:: MatlabMatrix_writer (LoggerHandle pr,
9495 MatrixHandle mh, const char *filename)
9596{
9697 matlabfile mf;
@@ -106,7 +107,7 @@ MatlabMatrix_writer(ProgressReporter *pr,
106107 // Convert the matrix into a matlab object
107108 mc.sciMatrixTOmlArray (mh,ma);
108109 // If the SCIRun object has a name, use it
109- mh->get_property (" name" ,name);
110+ mh->properties (). get_property (" name" ,name);
110111 // Set a default name if none was supplied
111112 if ((name==" " )||(!mc.isvalidmatrixname (name))) name = " scirunmatrix" ;
112113 // Open the file
@@ -126,7 +127,7 @@ MatlabMatrix_writer(ProgressReporter *pr,
126127
127128
128129NrrdDataHandle
129- MatlabNrrd_reader (ProgressReporter * pr, const char *filename)
130+ SCIRun:: MatlabNrrd_reader (LoggerHandle pr, const char *filename)
130131{
131132 matlabfile mf;
132133 matlabconverter mc (pr);
@@ -168,8 +169,8 @@ MatlabNrrd_reader(ProgressReporter *pr, const char *filename)
168169}
169170
170171bool
171- MatlabNrrd_writer (ProgressReporter * pr,
172- NrrdDataHandle mh , const char *filename)
172+ SCIRun:: MatlabNrrd_writer (LoggerHandle pr,
173+ NrrdDataHandle nrrd , const char *filename)
173174{
174175 matlabfile mf;
175176 matlabconverter mc (pr);
@@ -178,12 +179,12 @@ MatlabNrrd_writer(ProgressReporter *pr,
178179
179180 try
180181 {
181- // Make sure we make it into a numeric array, no annotion and headers
182+ // Make sure we make it into a numeric array, no annotation and headers
182183 mc.converttonumericmatrix ();
183184 // Convert the object
184- mc.sciNrrdDataTOmlArray (mh ,ma);
185+ mc.sciNrrdDataTOmlArray (nrrd ,ma);
185186 // Check if the object has a name
186- mh-> get_property (" name" ,name);
187+ nrrd-> properties (). get_property (" name" ,name);
187188 // if no name available give it one
188189 if ((name==" " )||(!mc.isvalidmatrixname (name))) name = " scirunnrrd" ;
189190 // Open the file
@@ -203,7 +204,7 @@ MatlabNrrd_writer(ProgressReporter *pr,
203204
204205
205206FieldHandle
206- MatlabField_reader (ProgressReporter * pr, const char *filename)
207+ SCIRun:: MatlabField_reader (LoggerHandle pr, const char *filename)
207208{
208209 matlabfile mf;
209210 // Make sure that errors are forwarded in the conversion process
@@ -248,8 +249,8 @@ MatlabField_reader(ProgressReporter *pr, const char *filename)
248249}
249250
250251bool
251- MatlabField_writer (ProgressReporter * pr,
252- FieldHandle mh , const char *filename)
252+ SCIRun:: MatlabField_writer (LoggerHandle pr,
253+ FieldHandle field , const char *filename)
253254{
254255 matlabfile mf;
255256 // Make sure that errors are forwarded in the conversion process
@@ -262,9 +263,9 @@ MatlabField_writer(ProgressReporter *pr,
262263 // We want all the annotation. A field without annotation is hard to use
263264 mc.converttostructmatrix ();
264265 // Convert the object
265- mc.sciFieldTOmlArray (mh ,ma);
266+ mc.sciFieldTOmlArray (field ,ma);
266267 // Get the name
267- mh-> get_property (" name" ,name);
268+ field-> properties (). get_property (" name" ,name);
268269 // If no name, set a default
269270 if ((name==" " )||(!mc.isvalidmatrixname (name))) name = " scirunfield" ;
270271 // Write the object to the file
@@ -280,9 +281,3 @@ MatlabField_writer(ProgressReporter *pr,
280281 return (true );
281282}
282283
283- static MatrixIEPlugin MatlabMatrix_plugin (" Matlab Matrix" ," .mat" , " *.mat" , MatlabMatrix_reader, MatlabMatrix_writer);
284- static FieldIEPlugin MatlabField_plugin (" Matlab Field" ," .mat" , " *.mat" ,MatlabField_reader,MatlabField_writer);
285- static NrrdIEPlugin MatlabNrrd_plugin (" Matlab Matrix" ," .mat" , " *.mat" ,MatlabNrrd_reader,MatlabNrrd_writer);
286-
287- } // end namespace SCIRun
288-
0 commit comments