Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ else()
find_package(ISMRMRD 1.4.2 REQUIRED)
# Add ISMRMRD to search path for FFTW3
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${ISMRMRD_DIR}")
find_package(FFTW3 COMPONENTS single REQUIRED)
find_package(FFTW3 COMPONENTS single double threads REQUIRED)
ADD_SUBDIRECTORY(xGadgetron)
set(SIRF_BUILT_WITH_ISMRMRD TRUE PARENT_SCOPE)
set(ISMRMRD_VERSION ${ISMRMRD_VERSION} PARENT_SCOPE)
Expand Down
4 changes: 4 additions & 0 deletions src/Registration/cReg/NiftyAladinSym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ limitations under the License.
#include "sirf/Reg/NiftiImageData3D.h"
#include "sirf/Reg/NiftiImageData3DDeformation.h"
#include "sirf/Reg/NiftiImageData3DDisplacement.h"
// Compatibility with NiftyReg builds where _reg_aladin.h still references
// InputTransform while only TransformationMatrix is declared.
#define InputTransform TransformationMatrix
#include <_reg_aladin_sym.h>
#undef InputTransform

using namespace sirf;

Expand Down
2 changes: 2 additions & 0 deletions src/xGadgetron/cGadgetron/FourierEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void sirf::CartesianFourierEncoding::forward(MRAcquisitionData& ac, const CFImag
int kz = nz/2 - kz_lim.center + acq.idx().kspace_encode_step_2;

for (unsigned int c = 0; c < nc; c++) {
#pragma omp parallel for
for (unsigned int s = 0; s < nx; s++) {
acq.data(s, c) = ci(s, ky, kz, c);
}
Expand Down Expand Up @@ -212,6 +213,7 @@ void sirf::CartesianFourierEncoding::backward(CFImage& img, const MRAcquisitionD
int z = nz/2 - kz_lim.center + acq.idx().kspace_encode_step_2;

for (unsigned int c = 0; c < nc; c++) {
#pragma omp parallel for

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I'm not sure if this is thread-safe. I've read some things about aligning etc (to do +=, you need to fetch, compute, store, which if your computer does the fetch/store in a larger chunk than the data element, can get you into trouble). Can't find the reference though.

Alternative is atomic, but obviously slower.

BTW, you can collapse loops, but not in Visual Studio C++ (it support OpenMP 2), so you need some ugly ifdefs which I can point you to.

Also, in most compilers, #pragma omp will lead to compilation warnings when not using OpenMP, so in STIR, we put some more #ifdef around it...

for (unsigned int s = 0; s < readout; s++) {
ci(s, y, z, c) += acq.data(s, c);
}
Expand Down
Loading