Skip to content

Commit

Permalink
Merge pull request #105 from ahsanjav/trajAttachOpt
Browse files Browse the repository at this point in the history
Make trajectory attaching optional
  • Loading branch information
kspaceKelvin authored Feb 27, 2023
2 parents abb8bb7 + 031d07e commit a485371
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 8)
set(SIEMENS_TO_ISMRMRD_VERSION_PATCH 9)
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
Expand Down
15 changes: 9 additions & 6 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ getTrajectory(const std::vector<std::string> &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<float> &traj,
bool isAdjustCoilSens, bool isAdjQuietCoilSens, bool isVB, bool isNX, bool attachTrajectory, ISMRMRD::NDArray<float> &traj,
const sScanHeader &scanhead, const std::vector<ChannelHeaderAndData> &channels);

void readScanHeader(std::ifstream &siemens_dat, bool VBFILE, sMDH &mdh, sScanHeader &scanhead);
Expand Down Expand Up @@ -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;

Expand All @@ -468,6 +468,7 @@ int main(int argc, char* argv[]) {
("allMeas,Z", po::value<bool>(&all_measurements)->implicit_value(true), "<All measurements flag>")
("multiMeasFile,M", po::value<bool>(&multi_meas_file)->implicit_value(true), "<Multiple measurements in single output file flag>")
("skipSyncData", po::value<bool>(&skip_syncdata)->implicit_value(true), "<Skip syncdata (PMU) conversion>")
("attachTrajectory", po::value<bool>(&attachTrajectory)->implicit_value(true), "<Attach trajectories using vds design>")
("pMap,m", po::value<std::string>(&parammap_file), "<Parameter map XML file>")
("pMapStyle,x", po::value<std::string>(&parammap_xsl), "<Parameter stylesheet XSL file>")
("user-map", po::value<std::string>(&usermap_file), "<Provide a parameter map XML file>")
Expand Down Expand Up @@ -495,6 +496,7 @@ int main(int argc, char* argv[]) {
("allMeas,Z", "<All measurements flag>")
("multiMeasFile,M", "<Multiple measurements in single file flag>")
("skipSyncData", "<Skip syncdata (PMU) conversion>")
("attachTrajectory", "<Attach trajectories using vds design>")
("pMap,m", "<Parameter map XML>")
("pMapStyle,x", "<Parameter stylesheet XSL>")
("output,o", "<ISMRMRD output file>")
Expand Down Expand Up @@ -842,7 +844,8 @@ int main(int argc, char* argv[]) {

auto ismrmrd_dataset = boost::make_shared<ISMRMRD::Dataset>(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<float> 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<float> traj;

uint32_t last_mask = 0;
unsigned long int acquisitions = 1;
Expand Down Expand Up @@ -953,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;
Expand Down Expand Up @@ -1081,7 +1084,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<float> &traj,
bool isAdjustCoilSens, bool isAdjQuietCoilSens, bool isVB, bool isNX, bool attachTrajectory, ISMRMRD::NDArray<float> &traj,
const sScanHeader &scanhead, const std::vector<ChannelHeaderAndData> &channels) {
ISMRMRD::Acquisition ismrmrd_acq;
// The number of samples, channels and trajectory dimensions is set below
Expand Down Expand Up @@ -1225,7 +1228,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 (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
Expand Down

0 comments on commit a485371

Please sign in to comment.