diff --git a/src/xSTIR/cSTIR/cstir.cpp b/src/xSTIR/cSTIR/cstir.cpp index ab6f515b5..c7cbb4956 100644 --- a/src/xSTIR/cSTIR/cstir.cpp +++ b/src/xSTIR/cSTIR/cstir.cpp @@ -183,7 +183,8 @@ void* cSTIR_newObject(const char* name) if (sirf::iequals(name, "LogcoshPrior")) return NEW_OBJECT_HANDLE(LogPrior3DF); if (sirf::iequals(name, "RelativeDifferencePrior")) - return NEW_OBJECT_HANDLE(RDPrior3DF); + return NEW_OBJECT_HANDLE(xSTIR_RelativeDifferencePrior3DF); + //return NEW_OBJECT_HANDLE(RDPrior3DF); #ifdef STIR_WITH_CUDA if (sirf::iequals(name, "CudaRelativeDifferencePrior")) return NEW_OBJECT_HANDLE(CudaRDPrior3DF); diff --git a/src/xSTIR/cSTIR/cstir_p.cpp b/src/xSTIR/cSTIR/cstir_p.cpp index e08f3b9e9..532b46597 100644 --- a/src/xSTIR/cSTIR/cstir_p.cpp +++ b/src/xSTIR/cSTIR/cstir_p.cpp @@ -707,10 +707,12 @@ void* sirf::cSTIR_setRelativeDifferencePriorParameter (DataHandle* hp, const char* name, const DataHandle* hv) { - auto& prior = objectFromHandle>(hp); + //auto& prior = objectFromHandle>(hp); + auto& prior = objectFromHandle(hp); if (sirf::iequals(name, "only_2D")) { - auto& xrdp = objectFromHandle(hp); - xrdp.only2D(dataFromHandle((void*)hv)); + //auto& xrdp = objectFromHandle(hp); + //xrdp.only2D(dataFromHandle((void*)hv)); + prior.only2D(dataFromHandle((void*)hv)); } else if (sirf::iequals(name, "kappa")) { auto& id = objectFromHandle(hv); @@ -729,7 +731,8 @@ void* sirf::cSTIR_RelativeDifferencePriorParameter (DataHandle* hp, const char* name) { - auto& prior = objectFromHandle>(hp); + //auto& prior = objectFromHandle>(hp); + auto& prior = objectFromHandle(hp); if (sirf::iequals(name, "kappa")) { auto sptr_im = std::make_shared(*prior.get_kappa_sptr()); return newObjectHandle(sptr_im); diff --git a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h index a122b73ed..68d464b31 100644 --- a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h +++ b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h @@ -39,6 +39,8 @@ limitations under the License. #include "sirf/common/iequals.h" #include "sirf/common/JacobiCG.h" #include "sirf/STIR/stir_data_containers.h" + +#include "stir/recon_buildblock/GibbsRelativeDifferencePenalty.h" #include "stir/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMeanAndProjData.h" #include "stir/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin.h" #include "stir/GeneralisedPoissonNoiseGenerator.h" @@ -1143,7 +1145,8 @@ The actual algorithm is described in } }; - class xSTIR_RelativeDifferencePrior3DF : public stir::RelativeDifferencePrior < float > { + class xSTIR_RelativeDifferencePrior3DF : public stir::GibbsRelativeDifferencePenalty { + //class xSTIR_RelativeDifferencePrior3DF : public stir::RelativeDifferencePrior { public: void only2D(int only) { only_2D = only != 0;