From 834dfe55c5b336eac9fd4b32fb3931999041ceaf Mon Sep 17 00:00:00 2001 From: ahsan Date: Fri, 23 Sep 2022 21:51:49 +0000 Subject: [PATCH 1/5] removed traj attaching --- main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 0dd5582..5fae201 100644 --- a/main.cpp +++ b/main.cpp @@ -842,7 +842,8 @@ int main(int argc, char* argv[]) { auto ismrmrd_dataset = boost::make_shared(ismrmrd_file.c_str(), ismrmrd_group.c_str(), true); //If this is a spiral acquisition, we will calculate the trajectory and add it to the individual profilesISMRMRD::NDArray traj; - auto traj = getTrajectory(wip_double, trajectory, dwell_time_0, radial_views); +// auto traj = getTrajectory(wip_double, trajectory, dwell_time_0, radial_views); + ISMRMRD::NDArray traj; uint32_t last_mask = 0; unsigned long int acquisitions = 1; @@ -1220,7 +1221,7 @@ getAcquisition(bool flash_pat_ref_scan, const Trajectory &trajectory, long dwell ismrmrd_acq.encoding_space_ref() = 1; } - if ((trajectory == Trajectory::TRAJECTORY_SPIRAL) & !(ismrmrd_acq.isFlagSet( + if (0 && (trajectory == Trajectory::TRAJECTORY_SPIRAL) & !(ismrmrd_acq.isFlagSet( ISMRMRD::ISMRMRD_ACQ_IS_NOISE_MEASUREMENT))) { //Spiral and not noise, we will add the trajectory to the data // from above we have the following From 4dff019755fdbbacebb3340ef83f696bedc3869a Mon Sep 17 00:00:00 2001 From: ahsan Date: Fri, 23 Sep 2022 22:10:54 +0000 Subject: [PATCH 2/5] addfiles --- .vscode/c_cpp_properties.json | 33 ++++++++++++ .vscode/launch.json | 32 +++++++++++ .vscode/settings.json | 99 +++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..8d904ce --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,33 @@ +{ + "env": { + "conda_env": "/home/javeda2/mambaforge/envs/gadgetron/" + }, + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**", + "/home/javeda2/mambaforge/envs/gadgetron/**" + ], + "defines": [], + "compilerPath": "/home/javeda2/mambaforge/envs/gadgetron/bin/x86_64-conda-linux-gnu-c99", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "linux-clang-x64", + "configurationProvider": "ms-vscode.cmake-tools" + }, + { + "name": "Linux_Container", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/opt/conda/envs/gadgetron/bin/x86_64-conda_cos6-linux-gnu-gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "linux-clang-x64", + "configurationProvider": "ms-vscode.cmake-tools" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e4a8265 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "siemens to ismrmrd", + "type": "cppdbg", + "request": "launch", + "program": "/home/javeda2/mambaforge/envs/gadgetron/bin/siemens_to_ismrmrd", + "args": ["-f","/home/javeda2/ldrive/Javed/MRDATA/data_2022/sandbox_wip/20220921_HV/20220921_123555_meas_MID00114_FID65582_FB_highres_1.75mm_iso.dat","-z","3","-o","/home/javeda2/ldrive/Javed/MRDATA/data_2022/sandbox_wip/20220921_HV/test.h5"], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [{"name":"PATH","value":"/home/javeda2/mambaforge/envs/gadgetron/bin/"},{"name":"LD_LIBRARY_PATH","value":"/home/javeda2/mambaforge/envs/gadgetron/lib/"}], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dc246e2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,99 @@ +{ + "files.associations": { + "*.ipp": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "csetjmp": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "strstream": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "chrono": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "cstdint": "cpp", + "deque": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "shared_mutex": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cfenv": "cpp", + "cinttypes": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "variant": "cpp", + "__bit_reference": "cpp", + "__hash_table": "cpp", + "__split_buffer": "cpp", + "__tree": "cpp", + "filesystem": "cpp", + "forward_list": "cpp", + "span": "cpp", + "valarray": "cpp" + }, + "cmake.configureOnOpen": true, + "cmake.preferredGenerators": [ + "Ninja", + "Unix Makefiles" + ], + //"cmake.cmakePath": "/opt/conda/envs/gadgetron/bin/cmake", + // "cmake.cmakePath": "/home/javeda2/anaconda3/envs/gadgetron/bin/cmake", + "cmake.environment": { + // "PATH": "/home/javeda2/anaconda3/envs/gadgetron/bin:/home/javeda2/anaconda3/bin:/home/javeda2/anaconda3/envs/gadgetron/include:/bin:${env:PATH}", ///home/javeda2/local/bin:/home/javeda2/.local/bin:/home/javeda2/local/fsl/bin:/home/javeda2/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/javeda2/local/bin:/home/javeda2/.local/bin:/home/javeda2/local/fsl/bin:/home/javeda2/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/bin/remote-cli:/home/javeda2/.local/bin:/home/javeda2/anaconda3/bin:/home/javeda2/anaconda3/condabin:/usr/local/cuda/bin:/usr/local/MATLAB/R2021a/bin:/home/javeda2/local/bin:/home/javeda2/local/usr/bin:/bin:/bin:/home/javeda2/local/bin:/home/javeda2/local/lib:/home/javeda2/local/include: + // "LD_LIBRARY_PATH": "/home/javeda2/anaconda3/envs/gadgetron/lib/:/home/javeda2/anaconda3/envs/gadgetron/x86_64-conda-linux-gnu/sysroot/usr/lib/" + }, + "cmake.configureSettings": { + "BUILD_DYNAMIC": "ON", + "CMAKE_INSTALL_PREFIX": "/home/javeda2/mambaforge/envs/gadgetron/", + "CMAKE_PREFIX_PATH": "/home/javeda2/mambaforge/envs/gadgetron/" + }, +} \ No newline at end of file From 64abe478eaf5fbb84684297be665c53f00ad0213 Mon Sep 17 00:00:00 2001 From: ahsan Date: Tue, 27 Sep 2022 15:53:12 +0000 Subject: [PATCH 3/5] Attach Trajectory option --- CMakeLists.txt | 2 +- main.cpp | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1c0d35..8717222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ message(STATUS "Looking for packages in : ${CMAKE_PREFIX_PATH}") #VERSIONING set(SIEMENS_TO_ISMRMRD_VERSION_MAJOR 1) set(SIEMENS_TO_ISMRMRD_VERSION_MINOR 2) -set(SIEMENS_TO_ISMRMRD_VERSION_PATCH 4) +set(SIEMENS_TO_ISMRMRD_VERSION_PATCH 5) set(SIEMENS_TO_ISMRMRD_VERSION_STRING ${SIEMENS_TO_ISMRMRD_VERSION_MAJOR}.${SIEMENS_TO_ISMRMRD_VERSION_MINOR}.${SIEMENS_TO_ISMRMRD_VERSION_PATCH}) # Generate the converter_version.h header file diff --git a/main.cpp b/main.cpp index 5fae201..54cc560 100644 --- a/main.cpp +++ b/main.cpp @@ -97,7 +97,7 @@ getTrajectory(const std::vector &wip_double, const Trajectory &traj ISMRMRD::Acquisition getAcquisition(bool flash_pat_ref_scan, const Trajectory &trajectory, long dwell_time_0, long* global_table_pos, long max_channels, - bool isAdjustCoilSens, bool isAdjQuietCoilSens, bool isVB, bool isNX, ISMRMRD::NDArray &traj, + bool isAdjustCoilSens, bool isAdjQuietCoilSens, bool isVB, bool isNX, bool attachTrajectory, ISMRMRD::NDArray &traj, const sScanHeader &scanhead, const std::vector &channels); void readScanHeader(std::ifstream &siemens_dat, bool VBFILE, sMDH &mdh, sScanHeader &scanhead); @@ -453,7 +453,7 @@ int main(int argc, char* argv[]) { bool all_measurements = false; bool multi_meas_file = false; bool skip_syncdata = false; - + bool attachTrajectory = false; bool list = false; std::string to_extract; @@ -468,6 +468,7 @@ int main(int argc, char* argv[]) { ("allMeas,Z", po::value(&all_measurements)->implicit_value(true), "") ("multiMeasFile,M", po::value(&multi_meas_file)->implicit_value(true), "") ("skipSyncData", po::value(&skip_syncdata)->implicit_value(true), "") + ("attachTrajectory", po::value(&attachTrajectory)->implicit_value(true), "") ("pMap,m", po::value(¶mmap_file), "") ("pMapStyle,x", po::value(¶mmap_xsl), "") ("user-map", po::value(&usermap_file), "") @@ -495,6 +496,7 @@ int main(int argc, char* argv[]) { ("allMeas,Z", "") ("multiMeasFile,M", "") ("skipSyncData", "") + ("attachTrajectory", "") ("pMap,m", "") ("pMapStyle,x", "") ("output,o", "") @@ -954,7 +956,7 @@ int main(int argc, char* argv[]) { ismrmrd_dataset->appendAcquisition( getAcquisition(flash_pat_ref_scan, trajectory, dwell_time_0, global_table_pos, max_channels, isAdjustCoilSens, - isAdjQuietCoilSens, isVB, isNX, traj, scanhead, channels)); + isAdjQuietCoilSens, isVB, isNX, attachTrajectory, traj, scanhead, channels)); }//End of the while loop delete [] global_table_pos; @@ -1077,7 +1079,7 @@ void readScanHeader(std::ifstream &siemens_dat, bool VBFILE, sMDH &mdh, sScanHea ISMRMRD::Acquisition getAcquisition(bool flash_pat_ref_scan, const Trajectory &trajectory, long dwell_time_0, long* global_table_pos, long max_channels, - bool isAdjustCoilSens, bool isAdjQuietCoilSens, bool isVB, bool isNX, ISMRMRD::NDArray &traj, + bool isAdjustCoilSens, bool isAdjQuietCoilSens, bool isVB, bool isNX, bool attachTrajectory, ISMRMRD::NDArray &traj, const sScanHeader &scanhead, const std::vector &channels) { ISMRMRD::Acquisition ismrmrd_acq; // The number of samples, channels and trajectory dimensions is set below @@ -1221,7 +1223,7 @@ getAcquisition(bool flash_pat_ref_scan, const Trajectory &trajectory, long dwell ismrmrd_acq.encoding_space_ref() = 1; } - if (0 && (trajectory == Trajectory::TRAJECTORY_SPIRAL) & !(ismrmrd_acq.isFlagSet( + if (attachTrajectory && (trajectory == Trajectory::TRAJECTORY_SPIRAL) & !(ismrmrd_acq.isFlagSet( ISMRMRD::ISMRMRD_ACQ_IS_NOISE_MEASUREMENT))) { //Spiral and not noise, we will add the trajectory to the data // from above we have the following From 734a104b6654463f0ac626bf7044ef2a4e7903d4 Mon Sep 17 00:00:00 2001 From: ahsan Date: Tue, 27 Sep 2022 15:57:56 +0000 Subject: [PATCH 4/5] remove custom files from pull request --- .vscode/c_cpp_properties.json | 33 ------------ .vscode/launch.json | 32 ----------- .vscode/settings.json | 99 ----------------------------------- 3 files changed, 164 deletions(-) delete mode 100644 .vscode/c_cpp_properties.json delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 8d904ce..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "env": { - "conda_env": "/home/javeda2/mambaforge/envs/gadgetron/" - }, - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**", - "/home/javeda2/mambaforge/envs/gadgetron/**" - ], - "defines": [], - "compilerPath": "/home/javeda2/mambaforge/envs/gadgetron/bin/x86_64-conda-linux-gnu-c99", - "cStandard": "c11", - "cppStandard": "c++17", - "intelliSenseMode": "linux-clang-x64", - "configurationProvider": "ms-vscode.cmake-tools" - }, - { - "name": "Linux_Container", - "includePath": [ - "${workspaceFolder}/**" - ], - "defines": [], - "compilerPath": "/opt/conda/envs/gadgetron/bin/x86_64-conda_cos6-linux-gnu-gcc", - "cStandard": "c11", - "cppStandard": "c++17", - "intelliSenseMode": "linux-clang-x64", - "configurationProvider": "ms-vscode.cmake-tools" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index e4a8265..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "siemens to ismrmrd", - "type": "cppdbg", - "request": "launch", - "program": "/home/javeda2/mambaforge/envs/gadgetron/bin/siemens_to_ismrmrd", - "args": ["-f","/home/javeda2/ldrive/Javed/MRDATA/data_2022/sandbox_wip/20220921_HV/20220921_123555_meas_MID00114_FID65582_FB_highres_1.75mm_iso.dat","-z","3","-o","/home/javeda2/ldrive/Javed/MRDATA/data_2022/sandbox_wip/20220921_HV/test.h5"], - "stopAtEntry": false, - "cwd": "${fileDirname}", - "environment": [{"name":"PATH","value":"/home/javeda2/mambaforge/envs/gadgetron/bin/"},{"name":"LD_LIBRARY_PATH","value":"/home/javeda2/mambaforge/envs/gadgetron/lib/"}], - "externalConsole": false, - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - }, - { - "description": "Set Disassembly Flavor to Intel", - "text": "-gdb-set disassembly-flavor intel", - "ignoreFailures": true - } - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index dc246e2..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "files.associations": { - "*.ipp": "cpp", - "cctype": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "csetjmp": "cpp", - "csignal": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "any": "cpp", - "array": "cpp", - "atomic": "cpp", - "strstream": "cpp", - "bit": "cpp", - "*.tcc": "cpp", - "bitset": "cpp", - "chrono": "cpp", - "codecvt": "cpp", - "complex": "cpp", - "condition_variable": "cpp", - "cstdint": "cpp", - "deque": "cpp", - "list": "cpp", - "map": "cpp", - "set": "cpp", - "unordered_map": "cpp", - "unordered_set": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "optional": "cpp", - "random": "cpp", - "ratio": "cpp", - "regex": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "fstream": "cpp", - "future": "cpp", - "initializer_list": "cpp", - "iomanip": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "mutex": "cpp", - "new": "cpp", - "ostream": "cpp", - "shared_mutex": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "thread": "cpp", - "cfenv": "cpp", - "cinttypes": "cpp", - "typeindex": "cpp", - "typeinfo": "cpp", - "variant": "cpp", - "__bit_reference": "cpp", - "__hash_table": "cpp", - "__split_buffer": "cpp", - "__tree": "cpp", - "filesystem": "cpp", - "forward_list": "cpp", - "span": "cpp", - "valarray": "cpp" - }, - "cmake.configureOnOpen": true, - "cmake.preferredGenerators": [ - "Ninja", - "Unix Makefiles" - ], - //"cmake.cmakePath": "/opt/conda/envs/gadgetron/bin/cmake", - // "cmake.cmakePath": "/home/javeda2/anaconda3/envs/gadgetron/bin/cmake", - "cmake.environment": { - // "PATH": "/home/javeda2/anaconda3/envs/gadgetron/bin:/home/javeda2/anaconda3/bin:/home/javeda2/anaconda3/envs/gadgetron/include:/bin:${env:PATH}", ///home/javeda2/local/bin:/home/javeda2/.local/bin:/home/javeda2/local/fsl/bin:/home/javeda2/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/javeda2/local/bin:/home/javeda2/.local/bin:/home/javeda2/local/fsl/bin:/home/javeda2/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/bin/remote-cli:/home/javeda2/.local/bin:/home/javeda2/anaconda3/bin:/home/javeda2/anaconda3/condabin:/usr/local/cuda/bin:/usr/local/MATLAB/R2021a/bin:/home/javeda2/local/bin:/home/javeda2/local/usr/bin:/bin:/bin:/home/javeda2/local/bin:/home/javeda2/local/lib:/home/javeda2/local/include: - // "LD_LIBRARY_PATH": "/home/javeda2/anaconda3/envs/gadgetron/lib/:/home/javeda2/anaconda3/envs/gadgetron/x86_64-conda-linux-gnu/sysroot/usr/lib/" - }, - "cmake.configureSettings": { - "BUILD_DYNAMIC": "ON", - "CMAKE_INSTALL_PREFIX": "/home/javeda2/mambaforge/envs/gadgetron/", - "CMAKE_PREFIX_PATH": "/home/javeda2/mambaforge/envs/gadgetron/" - }, -} \ No newline at end of file From 3d7e05a11f7e5ceda95378b5a7bc39f8b492aba8 Mon Sep 17 00:00:00 2001 From: Ahsan Javed Date: Fri, 7 Oct 2022 10:24:26 -0400 Subject: [PATCH 5/5] Update main.cpp fixed typos --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 54cc560..2f1e3dd 100644 --- a/main.cpp +++ b/main.cpp @@ -468,7 +468,7 @@ int main(int argc, char* argv[]) { ("allMeas,Z", po::value(&all_measurements)->implicit_value(true), "") ("multiMeasFile,M", po::value(&multi_meas_file)->implicit_value(true), "") ("skipSyncData", po::value(&skip_syncdata)->implicit_value(true), "") - ("attachTrajectory", po::value(&attachTrajectory)->implicit_value(true), "") + ("attachTrajectory", po::value(&attachTrajectory)->implicit_value(true), "") ("pMap,m", po::value(¶mmap_file), "") ("pMapStyle,x", po::value(¶mmap_xsl), "") ("user-map", po::value(&usermap_file), "") @@ -496,7 +496,7 @@ int main(int argc, char* argv[]) { ("allMeas,Z", "") ("multiMeasFile,M", "") ("skipSyncData", "") - ("attachTrajectory", "") + ("attachTrajectory", "") ("pMap,m", "") ("pMapStyle,x", "") ("output,o", "")