[ismrmrd] 22/177: Merged into one library and cleaned up some CMake files.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.

commit 5561f13d8f245ad9d818b98251cc8a7101299a2a
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Mon Aug 25 16:05:02 2014 -0400

    Merged into one library and cleaned up some CMake files.
---
 CMakeLists.txt                             | 111 +++++---------
 examples/c++/CMakeLists.txt                |  22 +++
 {tests => examples}/c++/basic_test.cpp     |   6 +-
 examples/c/CMakeLists.txt                  |  23 +--
 ismrmrd.cpp                                |   2 +-
 ismrmrd.h                                  | 221 +++++++++++++++++++++++++++
 ismrmrd.hpp                                | 231 -----------------------------
 xml/CMakeLists.txt                         |  29 +---
 xml/{test_ismrmrd_xml.cpp => test_xml.cpp} |   0
 9 files changed, 299 insertions(+), 346 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95eb392..2cae7cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,33 +1,22 @@
 cmake_minimum_required(VERSION 2.8)
 project(ISMRMRD)
 
+# install into a named subdirectory
+set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/ismrmrd)
+
+# add project specific cmake find modules
+list(APPEND CMAKE_MODULE_PATH cmake)
+
+# enable ctest
 enable_testing()
 
-#Set the build type to Release if not specified
+# set the build type to Release if not specified
 IF(NOT CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE Release CACHE STRING
       "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
       FORCE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
-# define install paths globally
-set(ISMRMRD_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/ismrmrd)
-set(ISMRMRD_INSTALL_LIB_DIR ${ISMRMRD_INSTALL_PREFIX}/lib)
-set(ISMRMRD_INSTALL_INCLUDE_DIR ${ISMRMRD_INSTALL_PREFIX}/include)
-set(ISMRMRD_INSTALL_BIN_DIR ${ISMRMRD_INSTALL_PREFIX}/bin)
-set(ISMRMRD_INSTALL_MODULE_DIR ${ISMRMRD_INSTALL_PREFIX}/cmake)
-set(ISMRMRD_INSTALL_SCHEMA_DIR ${ISMRMRD_INSTALL_PREFIX}/schema)
-set(ISMRMRD_INSTALL_MATLAB_DIR ${ISMRMRD_INSTALL_PREFIX}/matlab)
-set(ISMRMRD_INSTALL_JAVA_DIR ${ISMRMRD_INSTALL_PREFIX}/java)
-set(ISMRMRD_INSTALL_PYTHON_DIR ${ISMRMRD_INSTALL_PREFIX}/python)
-set(ISMRMRD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(ISMRMRD_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-set(ISMRMRD_SCHEMA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/schema)
-set(ISMRMRD_SCHEMA_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/xsd)
-
-# add project specific cmake find modules
-list(APPEND CMAKE_MODULE_PATH ${ISMRMRD_MODULE_DIR})
-
 if (WIN32)
     add_definitions(-DWIN32 -D_WIN32 -D_WINDOWS)
     add_definitions(-DUNICODE -D_UNICODE)
@@ -43,74 +32,52 @@ endif (WIN32)
 # required packages for main library
 find_package(HDF5 1.8 COMPONENTS C HL REQUIRED)
 
-include_directories(${HDF5_C_INCLUDE_DIR})
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}/xml 
+    ${HDF5_C_INCLUDE_DIR})
 
-add_library(ismrmrd SHARED ismrmrd.c ismrmrd_dataset.c)
-add_library(ismrmrd++ SHARED ismrmrd.c ismrmrd.cpp ismrmrd_dataset.c)
+add_library(ismrmrd SHARED 
+		    ismrmrd.c 
+		    ismrmrd.cpp 
+		    ismrmrd_dataset.c
+  		    xml/ismrmrd_xml.cpp
+  		    xml/ismrmrd_meta.cpp
+  		    xml/pugixml.cpp)
 
-#The findHDF5.cmake does not work very well on Windows, let's help it out
+# findHDF5.cmake does not work very well on Windows, let's help it out
 if(WIN32)
     target_link_libraries(ismrmrd optimized ${HDF5_hdf5_LIBRARY_RELEASE})
     target_link_libraries(ismrmrd debug ${HDF5_hdf5_LIBRARY_DEBUG})
-    target_link_libraries(ismrmrd++ optimized ${HDF5_hdf5_LIBRARY_RELEASE})
-    target_link_libraries(ismrmrd++ debug ${HDF5_hdf5_LIBRARY_DEBUG})
 else(WIN32)
     target_link_libraries(ismrmrd ${HDF5_LIBRARIES})
-    target_link_libraries(ismrmrd++ ${HDF5_LIBRARIES})
 endif(WIN32)
 
-install(TARGETS ismrmrd ismrmrd++ DESTINATION ${ISMRMRD_INSTALL_LIB_DIR})
-
-install(FILES ${ISMRMRD_SOURCE_DIR}/ismrmrd.h
-    ${ISMRMRD_SOURCE_DIR}/ismrmrd.hpp
-    ${ISMRMRD_SOURCE_DIR}/ismrmrd_dataset.h
-    ${ISMRMRD_SOURCE_DIR}/ismrmrd_hdf5_datatypes.h
-    ${ISMRMRD_SOURCE_DIR}/ismrmrd_export.h
-    DESTINATION ${ISMRMRD_INSTALL_INCLUDE_DIR})
-
-# required packages for support xsd library
-find_package(XSD REQUIRED)
-find_package(XercesC REQUIRED)
-
-# process the XSD files
-set(XSDS ${ISMRMRD_SCHEMA_DIR}/ismrmrd.xsd)
-set(XSD_ARGS cxx-tree --generate-serialization)
-if ( WIN32 )
-    SET(XSD_ARGS cxx-tree --generate-serialization --export-symbol EXPORTISMRMRDXSD --hxx-prologue-file ${CMAKE_SOURCE_DIR}/ismrmrd_xsd_export.h)
-endif (WIN32)
-
-wrap_xsd(XSDS_SOURCES XSD_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/schema ${XSDS} OPTIONS ${XSD_ARGS})
-
-if ( WIN32 )
-    include_directories(${ISMRMRD_SCHEMA_SOURCE_DIR} ${XSD_INCLUDE_DIR}
-        ${XERCESC_INCLUDE_DIR} ${HDF5_CXX_INCLUDE_DIR} ${HDF5_C_INCLUDE_DIR})
-endif ( WIN32 )
-
-if ( NOT WIN32 )
-    add_library(ismrmrd_xsd SHARED ${XSDS_SOURCES})
-    include_directories(${XERCESC_INCLUDE_DIR})
-    target_link_libraries(ismrmrd_xsd ${XERCESC_LIBRARIES})
-endif ( NOT WIN32 )
+install(TARGETS ismrmrd DESTINATION lib)
 
-install(FILES ${XSDS} ${XSDS_SOURCES}
-    DESTINATION ${ISMRMRD_INSTALL_SCHEMA_DIR})
+install(FILES 
+    ismrmrd.h
+    ismrmrd_dataset.h
+    ismrmrd_export.h
+    xml/ismrmrd_xml.h
+    xml/ismrmrd_meta.h
+    DESTINATION include)
 
-if ( NOT WIN32 )
-    install(TARGETS ismrmrd_xsd DESTINATION ${ISMRMRD_INSTALL_LIB_DIR})
-endif ( NOT WIN32 )
+install(FILES
+    schema/ismrmrd.xsd
+    DESTINATION schema)
 
-install(FILES ${ISMRMRD_MODULE_DIR}/FindIsmrmrd.cmake
-    ${ISMRMRD_MODULE_DIR}/FindFFTW3.cmake
-    ${ISMRMRD_MODULE_DIR}/FindXSD.cmake
-    ${ISMRMRD_MODULE_DIR}/FindXercesC.cmake
-    ${ISMRMRD_MODULE_DIR}/FindNumPy.cmake
-    DESTINATION ${ISMRMRD_INSTALL_MODULE_DIR})
+install(FILES
+    cmake/FindIsmrmrd.cmake
+    cmake/FindFFTW3.cmake
+    cmake/FindNumPy.cmake
+    DESTINATION cmake)
 
-add_subdirectory(doc)
+#add_subdirectory(doc)
 add_subdirectory(examples/c)
-#add_subdirectory(examples/c++)
+add_subdirectory(examples/c++)
 #add_subdirectory(utilities)
 #add_subdirectory(tests)
-add_subdirectory(matlab)
+#add_subdirectory(matlab)
 #add_subdirectory(bindings)
 add_subdirectory(xml)
diff --git a/examples/c++/CMakeLists.txt b/examples/c++/CMakeLists.txt
index 93b268c..be36a04 100644
--- a/examples/c++/CMakeLists.txt
+++ b/examples/c++/CMakeLists.txt
@@ -1,3 +1,24 @@
+add_executable(ismrmrd_basic_test basic_test.cpp)
+target_link_libraries(ismrmrd_basic_test ismrmrd)
+
+install(TARGETS ismrmrd_basic_test DESTINATION bin)
+
+#find_package(FFTW3 COMPONENTS single)
+#if(FFTW3_FOUND)
+#    message("FFTW3 Found, building examples")
+#    add_executable(ismrmrd_create_dataset test_create_dataset.cpp)
+#    target_link_libraries(ismrmrd_create_dataset ismrmrd ${FFTW3_LIBRARIES})
+#    add_executable(ismrmrd_recon_dataset test_recon_dataset.cpp)
+#    target_link_libraries(ismrmrd_recon_dataset ismrmrd ${FFTW3_LIBRARIES})
+#    install(TARGETS ismrmrd_create_dataset
+#                              ismrmrd_recon_dataset
+#              DESTINATION bin)
+#else(FFTW3_FOUND)
+#       message("FFTW3 NOT Found, cannot build examples")
+#endif(FFTW3_FOUND)
+
+if(0)
+
 find_package(FFTW3 COMPONENTS single)
 
 if(FFTW3_FOUND)
@@ -34,3 +55,4 @@ else(FFTW3_FOUND)
        message("FFTW3 NOT Found, cannot build examples")
 endif(FFTW3_FOUND)
 
+endif(0)
diff --git a/tests/c++/basic_test.cpp b/examples/c++/basic_test.cpp
similarity index 93%
rename from tests/c++/basic_test.cpp
rename to examples/c++/basic_test.cpp
index 7c37ed4..099efbf 100644
--- a/tests/c++/basic_test.cpp
+++ b/examples/c++/basic_test.cpp
@@ -1,5 +1,6 @@
 #include <iostream>
-#include "ismrmrd.hpp"
+#include "ismrmrd.h"
+#include "ismrmrd_xml.h"
 
 int main (int args, char** argv) {
 
@@ -31,5 +32,8 @@ int main (int args, char** argv) {
   std::cout << "Number of samples: " << acq.number_of_samples() << std::endl;
   
 
+  ISMRMRD::IsmrmrdHeader h;
+  //serialize(h,std::cout);
+
   return 0;
 }
diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt
index b391157..0228828 100644
--- a/examples/c/CMakeLists.txt
+++ b/examples/c/CMakeLists.txt
@@ -1,21 +1,4 @@
-find_package(FFTW3 COMPONENTS single)
+add_executable(ismrmrd_c_demo main.c)
+target_link_libraries(ismrmrd_c_demo ismrmrd)
 
-if(NOT FFTW3_FOUND)
-    message("FFTW3 NOT Found, cannot build examples")
-    return()
-endif(NOT FFTW3_FOUND)
-
-message("FFTW3 Found, building C examples")
-include_directories(${ISMRMRD_SOURCE_DIR} ${ISMRMRD_SCHEMA_SOURCE_DIR} ${FFTW3_INCLUDE_DIR})
-if(WIN32)
-    # building with xsd sources on Windows
-    set_source_files_properties(${XSDS_SOURCES} PROPERTIES GENERATED TRUE)
-    add_executable(ismrmrd_c_demo main.c ${XSDS_SOURCES})
-    target_link_libraries(ismrmrd_c_demo ${XERCESC_LIBRARIES} ismrmrd ${FFTW3_LIBRARIES})
-else(WIN32)
-    # linking with ismrmrd_xsd on Linux / OSX
-    add_executable(ismrmrd_c_demo main.c)
-    target_link_libraries(ismrmrd_c_demo ismrmrd ismrmrd_xsd ${FFTW3_LIBRARIES})
-endif(WIN32)
-
-install(TARGETS ismrmrd_c_demo DESTINATION ${ISMRMRD_INSTALL_BIN_DIR})
+install(TARGETS ismrmrd_c_demo DESTINATION bin)
diff --git a/ismrmrd.cpp b/ismrmrd.cpp
index f22a014..0a9b4c7 100644
--- a/ismrmrd.cpp
+++ b/ismrmrd.cpp
@@ -1,4 +1,4 @@
-#include "ismrmrd.hpp"
+#include "ismrmrd.h"
 
 namespace ISMRMRD {
 
diff --git a/ismrmrd.h b/ismrmrd.h
index b6c04d8..0fcb6e3 100644
--- a/ismrmrd.h
+++ b/ismrmrd.h
@@ -328,6 +328,227 @@ void ismrmrd_quaternion_to_directions(float quat[4], float read_dir[3], float ph
 
 #ifdef __cplusplus
 } // extern "C"
+
+//
+//  ISMRMRD C++ Interface
+//
+
+// TODO:
+// - exports for all the classes
+
+class AcquisitionHeader {
+public:
+    AcquisitionHeader();
+
+    // Accessors and mutators
+    const uint16_t &version();
+    const uint64_t &flags();
+    uint32_t &measurement_uid();
+    uint32_t &scan_counter();
+    uint32_t &acquisition_time_stamp();
+    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
+    uint16_t &number_of_samples();
+    uint16_t &available_channels();
+    uint16_t &active_channels();
+    const uint64_t (&channel_mask())[ISMRMRD_CHANNEL_MASKS];
+    uint16_t &discard_pre();
+    uint16_t &discard_post();
+    uint16_t &center_sample();
+    uint16_t &encoding_space_ref();
+    uint16_t &trajectory_dimensions();
+    float &sample_time_us();
+    float (&position())[3];
+    float (&read_dir())[3];
+    float (&phase_dir())[3];
+    float (&slice_dir())[3];
+    float (&patient_table_position())[3];
+    ISMRMRD_EncodingCounters &idx();
+    int32_t (&user_int())[ISMRMRD_USER_INTS];
+    float (&user_float())[ISMRMRD_USER_FLOATS];
+
+    // Flag methods
+    bool isFlagSet(const uint64_t val);
+    void setFlag(const uint64_t val);
+    void clearFlag(const uint64_t val);
+    void clearAllFlags();
+
+    // Channel mask methods
+    // TODO: need to add the functionality for these
+    //bool isChannelActive(uint16_t channel_id);
+    //void setChannelActive(uint16_t channel_id);
+    //void setChannelNotActive(uint16_t channel_id);
+    //void setAllChannelsNotActive();
+
+protected:
+    ISMRMRD_AcquisitionHeader head_;
+};
+
+class Acquisition {
+public:
+    Acquisition();
+
+    // Accessors and mutators
+    const uint16_t &version();
+    const uint64_t &flags();
+    uint32_t &measurement_uid();
+    uint32_t &scan_counter();
+    uint32_t &acquisition_time_stamp();
+    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
+    const uint16_t &number_of_samples();
+    void number_of_samples(uint16_t num_samples);
+    uint16_t &available_channels();
+    const uint16_t &active_channels();
+    void active_channels(uint16_t num_active_channels);
+    const uint64_t (&channel_mask())[ISMRMRD_CHANNEL_MASKS];
+    uint16_t &discard_pre();
+    uint16_t &discard_post();
+    uint16_t &center_sample();
+    uint16_t &encoding_space_ref();
+    uint16_t &trajectory_dimensions();
+    float &sample_time_us();
+    float (&position())[3];
+    float (&read_dir())[3];
+    float (&phase_dir())[3];
+    float (&slice_dir())[3];
+    float (&patient_table_position())[3];
+    ISMRMRD_EncodingCounters &idx();
+    int32_t (&user_int())[ISMRMRD_USER_INTS];
+    float (&user_float())[ISMRMRD_USER_FLOATS];
+
+    // Flag methods
+    bool isFlagSet(const uint64_t val);
+    void setFlag(const uint64_t val);
+    void clearFlag(const uint64_t val);
+    void clearAllFlags();
+
+    // Channel mask methods
+    // TODO: need to add the functionality for these
+    //bool isChannelActive(uint16_t channel_id);
+    //void setChannelActive(uint16_t channel_id);
+    //void setChannelNotActive(uint16_t channel_id);
+    //void setAllChannelsNotActive();
+
+protected:
+    ISMRMRD_Acquisition acq_;
+};
+
+class ImageHeader {
+public:
+    // Constructors
+    ImageHeader();
+    ImageHeader(ImageHeader &hdr);
+    ImageHeader(ISMRMRD_ImageHeader *hdr);
+
+    // Accessors and mutators
+    const uint16_t &version();
+    const uint16_t &data_type();
+    void data_type(uint16_t dtype);
+    const uint64_t &flags();
+    uint32_t &measurement_uid();
+    const uint16_t (&matrix_size())[3];
+    void matrix_size(const uint16_t msize[3]);
+    float (&field_of_view())[3];
+    const uint16_t &channels();
+    void channels(const uint16_t num_channels);
+    float (&position())[3];
+    float (&read_dir())[3];
+    float (&phase_dir())[3];
+    float (&slice_dir())[3];
+    float (&patient_table_position())[3];
+    uint16_t &average();
+    uint16_t &slice();
+    uint16_t &contrast();
+    uint16_t &phase();
+    uint16_t &repetition();
+    uint16_t &set();
+    uint32_t &acquisition_time_stamp();
+    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
+    uint16_t &image_type();
+    uint16_t &image_index();
+    uint16_t &image_series_index();
+    int32_t (&user_int())[ISMRMRD_USER_INTS];
+    float (&user_float())[ISMRMRD_USER_FLOATS];
+    const uint32_t &attribute_string_len();
+
+    // Flag methods
+    bool isFlagSet(const uint64_t val);
+    void setFlag(const uint64_t val);
+    void clearFlag(const uint64_t val);
+    void clearAllFlags();
+
+protected:
+    ISMRMRD_ImageHeader head_;
+};
+
+class Image {
+public:
+    // Constructors
+    Image();
+    Image(Image &im);
+    Image(ISMRMRD_Image *im);
+
+    // Accessors and mutators
+    const uint16_t &version();
+    const uint16_t &data_type();
+    void data_type(uint16_t dtype);
+    const uint64_t &flags();
+    uint32_t &measurement_uid();
+    const uint16_t (&matrix_size())[3];
+    void matrix_size(const uint16_t msize[3]);
+    float (&field_of_view())[3];
+    const uint16_t &channels();
+    void channels(const uint16_t num_channels);
+    float (&position())[3];
+    float (&read_dir())[3];
+    float (&phase_dir())[3];
+    float (&slice_dir())[3];
+    float (&patient_table_position())[3];
+    uint16_t &average();
+    uint16_t &slice();
+    uint16_t &contrast();
+    uint16_t &phase();
+    uint16_t &repetition();
+    uint16_t &set();
+    uint32_t &acquisition_time_stamp();
+    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
+    uint16_t &image_type();
+    uint16_t &image_index();
+    uint16_t &image_series_index();
+    int32_t (&user_int())[ISMRMRD_USER_INTS];
+    float (&user_float())[ISMRMRD_USER_FLOATS];
+    const uint32_t &attribute_string_len();
+
+    // Flag methods
+    bool isFlagSet(const uint64_t val);
+    void setFlag(const uint64_t val);
+    void clearFlag(const uint64_t val);
+    void clearAllFlags();
+
+protected:
+    ISMRMRD_Image image_;
+};
+
+class NDArray {
+public:
+    // Constructors
+    NDArray();
+    NDArray(NDArray &arr);
+    NDArray(ISMRMRD_NDArray *arr);
+
+    // Accessors and mutators
+    const uint16_t &version();
+    const uint16_t &data_type();
+    void data_type(const uint16_t dtype);
+    const uint16_t &ndim();
+    void ndim(const uint16_t numdim);
+    uint16_t dims[ISMRMRD_NDARRAY_MAXDIM];
+    void *data;
+
+    
+protected:
+    ISMRMRD_NDArray arr;
+};
+
 } // namespace ISMRMRD
 #endif
 
diff --git a/ismrmrd.hpp b/ismrmrd.hpp
deleted file mode 100644
index 2d07460..0000000
--- a/ismrmrd.hpp
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-//  ISMRMRD C++ Interface
-//
-
-// TODO:
-// - exports for all the classes
-
-#include "ismrmrd.h"
-
-#pragma once
-#ifndef ISMRMRD_HPP
-#define ISMRMRD_HPP
-
-namespace ISMRMRD {
-
-class AcquisitionHeader {
-public:
-    AcquisitionHeader();
-
-    // Accessors and mutators
-    const uint16_t &version();
-    const uint64_t &flags();
-    uint32_t &measurement_uid();
-    uint32_t &scan_counter();
-    uint32_t &acquisition_time_stamp();
-    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
-    uint16_t &number_of_samples();
-    uint16_t &available_channels();
-    uint16_t &active_channels();
-    const uint64_t (&channel_mask())[ISMRMRD_CHANNEL_MASKS];
-    uint16_t &discard_pre();
-    uint16_t &discard_post();
-    uint16_t &center_sample();
-    uint16_t &encoding_space_ref();
-    uint16_t &trajectory_dimensions();
-    float &sample_time_us();
-    float (&position())[3];
-    float (&read_dir())[3];
-    float (&phase_dir())[3];
-    float (&slice_dir())[3];
-    float (&patient_table_position())[3];
-    ISMRMRD_EncodingCounters &idx();
-    int32_t (&user_int())[ISMRMRD_USER_INTS];
-    float (&user_float())[ISMRMRD_USER_FLOATS];
-
-    // Flag methods
-    bool isFlagSet(const uint64_t val);
-    void setFlag(const uint64_t val);
-    void clearFlag(const uint64_t val);
-    void clearAllFlags();
-
-    // Channel mask methods
-    // TODO: need to add the functionality for these
-    //bool isChannelActive(uint16_t channel_id);
-    //void setChannelActive(uint16_t channel_id);
-    //void setChannelNotActive(uint16_t channel_id);
-    //void setAllChannelsNotActive();
-
-protected:
-    ISMRMRD_AcquisitionHeader head_;
-};
-
-class Acquisition {
-public:
-    Acquisition();
-
-    // Accessors and mutators
-    const uint16_t &version();
-    const uint64_t &flags();
-    uint32_t &measurement_uid();
-    uint32_t &scan_counter();
-    uint32_t &acquisition_time_stamp();
-    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
-    const uint16_t &number_of_samples();
-    void number_of_samples(uint16_t num_samples);
-    uint16_t &available_channels();
-    const uint16_t &active_channels();
-    void active_channels(uint16_t num_active_channels);
-    const uint64_t (&channel_mask())[ISMRMRD_CHANNEL_MASKS];
-    uint16_t &discard_pre();
-    uint16_t &discard_post();
-    uint16_t &center_sample();
-    uint16_t &encoding_space_ref();
-    uint16_t &trajectory_dimensions();
-    float &sample_time_us();
-    float (&position())[3];
-    float (&read_dir())[3];
-    float (&phase_dir())[3];
-    float (&slice_dir())[3];
-    float (&patient_table_position())[3];
-    ISMRMRD_EncodingCounters &idx();
-    int32_t (&user_int())[ISMRMRD_USER_INTS];
-    float (&user_float())[ISMRMRD_USER_FLOATS];
-
-    // Flag methods
-    bool isFlagSet(const uint64_t val);
-    void setFlag(const uint64_t val);
-    void clearFlag(const uint64_t val);
-    void clearAllFlags();
-
-    // Channel mask methods
-    // TODO: need to add the functionality for these
-    //bool isChannelActive(uint16_t channel_id);
-    //void setChannelActive(uint16_t channel_id);
-    //void setChannelNotActive(uint16_t channel_id);
-    //void setAllChannelsNotActive();
-
-protected:
-    ISMRMRD_Acquisition acq_;
-};
-
-class ImageHeader {
-public:
-    // Constructors
-    ImageHeader();
-    ImageHeader(ImageHeader &hdr);
-    ImageHeader(ISMRMRD_ImageHeader *hdr);
-
-    // Accessors and mutators
-    const uint16_t &version();
-    const uint16_t &data_type();
-    void data_type(uint16_t dtype);
-    const uint64_t &flags();
-    uint32_t &measurement_uid();
-    const uint16_t (&matrix_size())[3];
-    void matrix_size(const uint16_t msize[3]);
-    float (&field_of_view())[3];
-    const uint16_t &channels();
-    void channels(const uint16_t num_channels);
-    float (&position())[3];
-    float (&read_dir())[3];
-    float (&phase_dir())[3];
-    float (&slice_dir())[3];
-    float (&patient_table_position())[3];
-    uint16_t &average();
-    uint16_t &slice();
-    uint16_t &contrast();
-    uint16_t &phase();
-    uint16_t &repetition();
-    uint16_t &set();
-    uint32_t &acquisition_time_stamp();
-    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
-    uint16_t &image_type();
-    uint16_t &image_index();
-    uint16_t &image_series_index();
-    int32_t (&user_int())[ISMRMRD_USER_INTS];
-    float (&user_float())[ISMRMRD_USER_FLOATS];
-    const uint32_t &attribute_string_len();
-
-    // Flag methods
-    bool isFlagSet(const uint64_t val);
-    void setFlag(const uint64_t val);
-    void clearFlag(const uint64_t val);
-    void clearAllFlags();
-
-protected:
-    ISMRMRD_ImageHeader head_;
-};
-
-class Image {
-public:
-    // Constructors
-    Image();
-    Image(Image &im);
-    Image(ISMRMRD_Image *im);
-
-    // Accessors and mutators
-    const uint16_t &version();
-    const uint16_t &data_type();
-    void data_type(uint16_t dtype);
-    const uint64_t &flags();
-    uint32_t &measurement_uid();
-    const uint16_t (&matrix_size())[3];
-    void matrix_size(const uint16_t msize[3]);
-    float (&field_of_view())[3];
-    const uint16_t &channels();
-    void channels(const uint16_t num_channels);
-    float (&position())[3];
-    float (&read_dir())[3];
-    float (&phase_dir())[3];
-    float (&slice_dir())[3];
-    float (&patient_table_position())[3];
-    uint16_t &average();
-    uint16_t &slice();
-    uint16_t &contrast();
-    uint16_t &phase();
-    uint16_t &repetition();
-    uint16_t &set();
-    uint32_t &acquisition_time_stamp();
-    uint32_t (&physiology_time_stamp())[ISMRMRD_PHYS_STAMPS];
-    uint16_t &image_type();
-    uint16_t &image_index();
-    uint16_t &image_series_index();
-    int32_t (&user_int())[ISMRMRD_USER_INTS];
-    float (&user_float())[ISMRMRD_USER_FLOATS];
-    const uint32_t &attribute_string_len();
-
-    // Flag methods
-    bool isFlagSet(const uint64_t val);
-    void setFlag(const uint64_t val);
-    void clearFlag(const uint64_t val);
-    void clearAllFlags();
-
-protected:
-    ISMRMRD_Image image_;
-};
-
-class NDArray {
-public:
-    // Constructors
-    NDArray();
-    NDArray(NDArray &arr);
-    NDArray(ISMRMRD_NDArray *arr);
-
-    // Accessors and mutators
-    const uint16_t &version();
-    const uint16_t &data_type();
-    void data_type(const uint16_t dtype);
-    const uint16_t &ndim();
-    void ndim(const uint16_t numdim);
-    uint16_t dims[ISMRMRD_NDARRAY_MAXDIM];
-    void *data;
-
-    
-protected:
-    ISMRMRD_NDArray;
-};
-
-} // namespace ISMRMRD
-
-#endif // ISMRMRD_HPP
diff --git a/xml/CMakeLists.txt b/xml/CMakeLists.txt
index 40c9c0c..6329526 100644
--- a/xml/CMakeLists.txt
+++ b/xml/CMakeLists.txt
@@ -1,29 +1,16 @@
-add_library(ismrmrd_xml SHARED 
-  ismrmrd_xml.h
-  ismrmrd_xml.cpp
-  ismrmrd_meta.h
-  ismrmrd_meta.cpp
-  pugixml.cpp
-  )
-
-add_executable(test_ismrmrd_xml
-  test_ismrmrd_xml.cpp
+add_executable(ismrmrd_test_xml
+  test_xml.cpp
   pugixml.cpp
 )
 
-add_executable(test_meta 
+target_link_libraries(ismrmrd_test_xml ismrmrd)
+
+add_executable(ismrmrd_test_meta 
   test_meta.cpp
+  pugixml.cpp
 )
 
-target_link_libraries(test_ismrmrd_xml
-  ismrmrd_xml)
-
-target_link_libraries(test_meta
-  ismrmrd_xml)
-
-install (FILES ismrmrd_xml.h ismrmrd_xml_export.h
-  DESTINATION ${ISMRMRD_INSTALL_INCLUDE_DIR})
+target_link_libraries(ismrmrd_test_meta ismrmrd)
 
-install (TARGETS ismrmrd_xml DESTINATION ${ISMRMRD_INSTALL_LIB_DIR})
+install (TARGETS ismrmrd_test_xml ismrmrd_test_meta DESTINATION bin)
 
-install (TARGETS test_ismrmrd_xml DESTINATION ${ISMRMRD_INSTALL_BIN_DIR})
diff --git a/xml/test_ismrmrd_xml.cpp b/xml/test_xml.cpp
similarity index 100%
rename from xml/test_ismrmrd_xml.cpp
rename to xml/test_xml.cpp

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list