32 #ifndef GADGETS_LIBRARY
33 #define GADGETS_LIBRARY
47 virtual void set_property(
const char* prop,
const char* value) = 0;
48 virtual std::string value_of(
const char* prop) = 0;
49 virtual std::string vxml(
const std::string& label)
const = 0;
50 std::string xml(
const std::string& label =
"")
const
61 Gadget(std::string name, std::string dll, std::string cl) :
62 gadget_(name), dll_(dll)
67 virtual void set_property(
const char* prop,
const char* value)
71 virtual std::string value_of(
const char* prop)
75 void add_property(
const char* prop,
const char* value)
79 virtual std::string vxml(
const std::string& label)
const
81 std::string xml_script(
"<gadget>\n");
83 xml_script +=
" <name>" + label +
':' + gadget_ +
"</name>\n";
85 xml_script +=
" <name>" + gadget_ +
"</name>\n";
86 xml_script +=
" <dll>" + dll_ +
"</dll>\n";
87 xml_script +=
" <classname>" + class_ +
"</classname>\n";
88 #if defined(_MSC_VER) && _MSC_VER < 1900
89 std::map<std::string, std::string>::const_iterator it;
91 typename std::map<std::string, std::string>::const_iterator it;
93 for (it = par_.begin(); it != par_.end(); ++it) {
94 xml_script +=
" <property>\n";
95 xml_script +=
" <name>" + it->first +
"</name>\n"; \
96 xml_script +=
" <value>" + it->second +
"</value>\n"; \
97 xml_script +=
" </property>\n";
99 xml_script +=
"</gadget>\n";
106 std::map<std::string, std::string> par_;
115 static const char* class_name()
117 return "GadgetIsmrmrdAcquisitionMessageReader";
119 virtual void set_property(
const char* prop,
const char* value) {}
120 virtual std::string value_of(
const char* prop)
122 return std::string(
"");
124 virtual std::string vxml(
const std::string& label)
const {
125 std::string xml_script(
"<reader>\n");
126 xml_script +=
" <slot>1008</slot>\n";
127 xml_script +=
" <dll>gadgetron_mricore</dll>\n";
129 " <classname>GadgetIsmrmrdAcquisitionMessageReader</classname>\n";
130 xml_script +=
"</reader>\n";
141 static const char* class_name()
143 return "GadgetIsmrmrdAcquisitionMessageWriter";
145 virtual void set_property(
const char* prop,
const char* value) {}
146 virtual std::string value_of(
const char* prop)
148 return std::string(
"");
150 virtual std::string vxml(
const std::string& label)
const {
151 std::string xml_script(
"<writer>\n");
152 xml_script +=
" <slot>1008</slot>\n";
153 xml_script +=
" <dll>gadgetron_mricore</dll>\n";
155 " <classname>GadgetIsmrmrdAcquisitionMessageWriter</classname>\n";
156 xml_script +=
"</writer>\n";
166 static const char* class_name()
168 return "MRIImageReader";
170 virtual void set_property(
const char* prop,
const char* value) {}
171 virtual std::string value_of(
const char* prop)
173 return std::string(
"");
175 virtual std::string vxml(
const std::string& label)
const {
176 std::string xml_script(
"<reader>\n");
177 xml_script +=
" <slot>1022</slot>\n";
178 xml_script +=
" <dll>gadgetron_mricore</dll>\n";
180 " <classname>MRIImageReader</classname>\n";
181 xml_script +=
"</reader>\n";
197 static const char* class_name()
199 return "MRIImageWriter";
201 virtual void set_property(
const char* prop,
const char* value) {}
202 virtual std::string value_of(
const char* prop)
204 return std::string(
"");
206 virtual std::string vxml(
const std::string& label)
const {
207 std::string xml_script(
"<writer>\n");
208 xml_script +=
" <slot>1022</slot>\n";
209 xml_script +=
" <dll>gadgetron_mricore</dll>\n";
210 xml_script +=
" <classname>MRIImageWriter</classname>\n";
211 xml_script +=
"</writer>\n";
221 static const char* class_name()
223 return "DicomImageWriter";
225 virtual void set_property(
const char* prop,
const char* value) {}
226 virtual std::string value_of(
const char* prop)
228 return std::string(
"");
230 virtual std::string vxml(
const std::string& label)
const {
231 std::string xml_script(
"<writer>\n");
232 xml_script +=
" <slot>1018</slot>\n";
233 xml_script +=
" <dll>gadgetron_dicom</dll>\n";
234 xml_script +=
" <classname>DicomImageWriter</classname>\n";
235 xml_script +=
"</writer>\n";
246 Gadget(
"NoiseAdjust",
"gadgetron_mricore",
"NoiseAdjustGadget")
248 static const char* class_name()
250 return "NoiseAdjustGadget";
260 Gadget(
"PCACoil",
"gadgetron_mricore",
"PCACoilGadget")
262 static const char* class_name()
264 return "PCACoilGadget";
274 Gadget(
"CoilReduction",
"gadgetron_mricore",
"CoilReductionGadget")
276 add_property(
"coil_mask",
"");
277 add_property(
"coils_out",
"128");
279 static const char* class_name()
281 return "CoilReductionGadget";
291 Gadget(
"AsymmetricEcho",
"gadgetron_mricore",
292 "AsymmetricEchoAdjustROGadget")
294 static const char* class_name()
296 return "AsymmetricEchoAdjustROGadget";
306 Gadget(
"RemoveROOversampling",
"gadgetron_mricore",
307 "RemoveROOversamplingGadget")
309 static const char* class_name()
311 return "RemoveROOversamplingGadget";
321 Gadget(
"AccTrig",
"gadgetron_mricore",
"AcquisitionAccumulateTriggerGadget")
323 add_property(
"trigger_dimension",
"repetition");
324 add_property(
"sorting_dimension",
"slice");
326 static const char* class_name()
328 return "AcquisitionAccumulateTriggerGadget";
338 Gadget(
"Buff",
"gadgetron_mricore",
"BucketToBufferGadget")
340 add_property(
"N_dimension",
"");
341 add_property(
"S_dimension",
"");
342 add_property(
"split_slices",
"true");
343 add_property(
"ignore_segment",
"true");
344 add_property(
"verbose",
"true");
346 static const char* class_name()
348 return "BucketToBufferGadget";
358 Gadget(
"PrepRef",
"gadgetron_mricore",
359 "GenericReconCartesianReferencePrepGadget")
361 add_property(
"debug_folder",
"");
362 add_property(
"perform_timing",
"true");
363 add_property(
"verbose",
"true");
364 add_property(
"average_all_ref_N",
"true");
365 add_property(
"average_all_ref_S",
"true");
366 add_property(
"prepare_ref_always",
"true");
368 static const char* class_name()
370 return "GenericReconCartesianReferencePrepGadget";
380 Gadget(
"EigenChannel",
"gadgetron_mricore",
381 "GenericReconEigenChannelGadget")
383 add_property(
"debug_folder",
"");
384 add_property(
"perform_timing",
"true");
385 add_property(
"verbose",
"true");
386 add_property(
"average_all_ref_N",
"true");
387 add_property(
"average_all_ref_S",
"true");
388 add_property(
"upstream_coil_compression",
"true");
389 add_property(
"upstream_coil_compression_thres",
"0.002");
390 add_property(
"upstream_coil_compression_num_modesKept",
"0");
392 static const char* class_name()
394 return "GenericReconEigenChannelGadget";
404 Gadget(
"PartialFourier",
"gadgetron_mricore",
405 "GenericReconPartialFourierHandlingFilterGadget")
407 add_property(
"debug_folder",
"");
408 add_property(
"perform_timing",
"false");
409 add_property(
"verbose",
"false");
410 add_property(
"skip_processing_meta_field",
"Skip_processing_after_recon");
411 add_property(
"partial_fourier_filter_RO_width",
"0.15");
412 add_property(
"partial_fourier_filter_E1_width",
"0.15");
413 add_property(
"partial_fourier_filter_E2_width",
"0.15");
414 add_property(
"partial_fourier_filter_densityComp",
"false");
416 static const char* class_name()
418 return "GenericReconPartialFourierHandlingFilterGadget";
428 Gadget(
"ReconKSpaceFiltering",
"gadgetron_mricore",
429 "GenericReconKSpaceFilteringGadget")
431 add_property(
"debug_folder",
"");
432 add_property(
"perform_timing",
"false" );
433 add_property(
"verbose",
"false" );
434 add_property(
"skip_processing_meta_field",
"Skip_processing_after_recon" );
435 add_property(
"filterRO",
"Gaussian" );
436 add_property(
"filterRO_sigma",
"1.0" );
437 add_property(
"filterRO_width",
"0.15" );
438 add_property(
"filterE1",
"Gaussian" );
439 add_property(
"filterE1_sigma",
"1.0" );
440 add_property(
"filterE1_width",
"0.15" );
441 add_property(
"filterE2",
"Gaussian" );
442 add_property(
"filterE2_sigma",
"1.0" );
443 add_property(
"filterE2_width",
"0.15" );
445 static const char* class_name()
447 return "GenericReconKSpaceFilteringGadget";
457 Gadget(
"SimpleRecon",
"gadgetron_mricore",
"SimpleReconGadget")
459 static const char* class_name()
461 return "SimpleReconGadget";
471 Gadget(
"FFT",
"gadgetron_mricore",
"FFTGadget")
473 static const char* class_name()
485 Gadget(
"Combine",
"gadgetron_mricore",
"CombineGadget")
487 static const char* class_name()
489 return "CombineGadget";
499 Gadget(
"Recon",
"gadgetron_mricore",
"GenericReconCartesianFFTGadget")
501 add_property(
"image_series",
"0");
502 add_property(
"coil_map_algorithm",
"Inati");
503 add_property(
"debug_folder",
"");
504 add_property(
"perform_timing",
"true");
505 add_property(
"verbose",
"true");
507 static const char* class_name()
509 return "GenericReconCartesianFFTGadget";
519 Gadget(
"CartesianGrappa",
"gadgetron_mricore",
520 "GenericReconCartesianGrappaGadget")
522 add_property(
"image_series",
"0");
523 add_property(
"coil_map_algorithm",
"Inati");
524 add_property(
"downstream_coil_compression",
"true");
525 add_property(
"downstream_coil_compression_thres",
"0.01");
526 add_property(
"downstream_coil_compression_num_modesKept",
"0");
527 add_property(
"send_out_gfactor",
"true");
528 add_property(
"debug_folder",
"");
529 add_property(
"perform_timing",
"true");
530 add_property(
"verbose",
"true");
532 static const char* class_name()
534 return "GenericReconCartesianGrappaGadget";
544 Gadget(
"FOVAdjustment",
"gadgetron_mricore",
545 "GenericReconFieldOfViewAdjustmentGadget")
547 add_property(
"debug_folder",
"");
548 add_property(
"perform_timing",
"false");
549 add_property(
"verbose",
"false");
551 static const char* class_name()
553 return "GenericReconFieldOfViewAdjustmentGadget";
563 Gadget(
"Scaling",
"gadgetron_mricore",
564 "GenericReconImageArrayScalingGadget")
566 add_property(
"perform_timing",
"false");
567 add_property(
"verbose",
"false");
568 add_property(
"min_intensity_value",
"64");
569 add_property(
"max_intensity_value",
"4095");
570 add_property(
"scalingFactor",
"10.0");
571 add_property(
"use_constant_scalingFactor",
"true");
572 add_property(
"scalingFactor_dedicated",
"100.0");
573 add_property(
"auto_scaling_only_once",
"true");
575 static const char* class_name()
577 return "GenericReconImageArrayScalingGadget";
587 Gadget(
"FatWater",
"gadgetron_fatwater",
"FatWaterGadget")
589 static const char* class_name()
591 return "FatWaterGadget";
601 Gadget(
"ImageArraySplit",
"gadgetron_mricore",
"ImageArraySplitGadget")
603 static const char* class_name()
605 return "ImageArraySplitGadget";
615 Gadget(
"PhysioInterpolation",
"gadgetron_mricore",
"PhysioInterpolationGadget")
617 add_property(
"phases",
"30");
618 add_property(
"mode",
"0");
619 add_property(
"first_beat_on_trigger",
"true");
620 add_property(
"interp_method",
"BSpline");
622 static const char* class_name()
624 return "PhysioInterpolationGadget";
636 add_property(
"mode",
"0");
637 add_property(
"deviceno",
"0");
638 add_property(
"profiles_per_frame",
"0");
639 add_property(
"rotations_per_reconstruction",
"0");
640 add_property(
"frames_per_rotation",
"0");
641 add_property(
"buffer_frames_per_rotation",
"0");
642 add_property(
"buffer_length_in_rotations",
"1");
643 add_property(
"buffer_using_solver",
"false");
644 add_property(
"buffer_convolution_kernel_width",
"5.5");
645 add_property(
"buffer_convolution_oversampling_factor",
"1.25");
646 add_property(
"reconstruction_os_factor_x",
"1.0");
647 add_property(
"reconstruction_os_factor_y",
"1.0");
648 add_property(
"output_timing",
"false");
664 GPURadialPrepGadget(
"gpuRadialSensePrepGadget",
"gadgetron_gpuradial",
"gpuRadialSensePrepGadget")
666 static const char* class_name()
668 return "GPURadialSensePrepGadget";
677 GPUSenseGadget(std::string name, std::string dll, std::string cl) :
680 add_property(
"deviceno",
"0");
681 add_property(
"setno",
"0");
682 add_property(
"sliceno",
"0");
683 add_property(
"oversampling_factor",
"1.5");
684 add_property(
"kernel_width",
"5.5");
685 add_property(
"save_individual_frames",
"true");
686 add_property(
"output_convergence",
"false");
687 add_property(
"rotations_to_discard",
"0");
688 add_property(
"output_timing",
"false");
704 GPUSenseGadget(
"gpuCgSenseGadget",
"gadgetron_gpuparallelmri",
"gpuCgSenseGadget")
706 add_property(
"kappa",
"0.3");
707 add_property(
"number_of_iterations",
"5");
708 add_property(
"cg_limit",
"1e-6");
710 static const char* class_name()
712 return "GPUCGSenseGadget";
722 Gadget(
"Extract",
"gadgetron_mricore",
"ExtractGadget")
724 add_property(
"extract_mask",
"0");
725 add_property(
"extract_magnitude",
"true");
726 add_property(
"extract_real",
"false");
727 add_property(
"extract_imag",
"false");
728 add_property(
"extract_phase",
"false");
730 static const char* class_name()
732 return "ExtractGadget";
742 Gadget(
"AutoScale",
"gadgetron_mricore",
"AutoScaleGadget")
744 static const char* class_name()
746 return "AutoScaleGadget";
756 Gadget(
"ComplexToFloatAttrib",
"gadgetron_mricore",
"ComplexToFloatGadget")
758 static const char* class_name()
760 return "ComplexToFloatGadget";
772 std::string max_int) :
775 add_property(
"min_intensity",
"0");
776 add_property(
"max_intensity", max_int.c_str());
777 add_property(
"intensity_offset",
"0");
795 static const char* class_name()
797 return "FloatToUShortGadget";
808 "FloatToShortGadget",
"32767")
810 static const char* class_name()
812 return "FloatToShortGadget";
838 Gadget(
"ImageFinish",
"gadgetron_mricore",
"ImageFinishGadget")
840 static const char* class_name()
842 return "ImageFinishGadget";
852 Gadget(
"DicomFinish",
"gadgetron_dicom",
"DicomFinishGadget")
854 static const char* class_name()
856 return "DicomFinishGadget";
866 Gadget(
"AcquisitionFinish",
"gadgetron_mricore",
"AcquisitionFinishGadget")
868 static const char* class_name()
870 return "AcquisitionFinishGadget";
880 static const char* class_name()
882 return "SimpleReconGadgetSet";
884 virtual void set_property(
const char* prop,
const char* value)
888 aat_.set_property(prop, value);
892 bb_.set_property(prop, value);
894 THROW(
"unknown gadget parameter");
896 virtual std::string value_of(
const char* prop)
900 return aat_.value_of(prop);
904 return bb_.value_of(prop);
905 THROW(
"unknown gadget parameter");
907 virtual std::string vxml(
const std::string& label)
const
909 std::string xml_script;
910 xml_script += aat_.xml();
911 xml_script += bb_.xml();
912 xml_script += sr_.xml();
913 xml_script += ias_.xml();
Class for the generator of xml definition of AcquisitionAccumulateTriggerGadget.
Definition: gadget_lib.h:318
Class for the generator of xml definition of AcquisitionFinishGadget.
Definition: gadget_lib.h:863
Class for the generator of xml definition of AsymmetricEchoAdjustROGadget.
Definition: gadget_lib.h:288
Class for the generator of xml definition of AutoScaleGadget.
Definition: gadget_lib.h:739
Class for the generator of xml definition of BucketToBufferGadget.
Definition: gadget_lib.h:335
Class for the generator of xml definition of CoilReductionGadget.
Definition: gadget_lib.h:271
Class for the generator of xml definition of CombineGadget.
Definition: gadget_lib.h:482
Class for the generator of xml definition of ComplexToFloatGadget.
Definition: gadget_lib.h:753
Class for the generator of xml definition of DicomFinishGadget.
Definition: gadget_lib.h:849
Class for DicomImageWriter gadget xml-definition generator.
Definition: gadget_lib.h:219
Class for the generator of xml definition of FFTGadget.
Definition: gadget_lib.h:468
Class for the generator of xml definition of FatWaterGadget.
Definition: gadget_lib.h:584
Class for the generator of xml definition of FloatToFixPointGadget.
Definition: gadget_lib.h:767
Class for the generator of xml definition of FloatToShortGadget.
Definition: gadget_lib.h:804
Class for the generator of xml definition of FloatToUShortGadget.
Definition: gadget_lib.h:790
Class for the generator of xml definition of GPUCGSenseGadget.
Definition: gadget_lib.h:701
Class for the generator of xml definition of GPURadialPrepGadget.
Definition: gadget_lib.h:631
Class for the generator of xml definition of GPURadialSensePrepGadget.
Definition: gadget_lib.h:661
Class for the generator of xml definition of GPUSenseGadget.
Definition: gadget_lib.h:675
Class for a gadget xml-definition generator.
Definition: gadget_lib.h:59
Class for the generator of xml definition of GenericReconCartesianFFTGadget.
Definition: gadget_lib.h:496
Class for the generator of xml definition of GenericReconCartesianGrappaGadget.
Definition: gadget_lib.h:516
Class for the generator of xml definition of GenericReconCartesianReferencePrepGadget.
Definition: gadget_lib.h:355
Class for the generator of xml definition of GenericReconEigenChannelGadget.
Definition: gadget_lib.h:377
Class for the generator of xml definition of GenericReconFieldOfViewAdjustmentGadget.
Definition: gadget_lib.h:541
Class for the generator of xml definition of GenericReconImageArrayScalingGadget.
Definition: gadget_lib.h:560
Class for the generator of xml definition of GenericReconKSpaceFilteringGadget.
Definition: gadget_lib.h:425
Class for the generator of xml definition of GenericReconPartialFourierHandlingFilterGadget.
Definition: gadget_lib.h:401
Class for the generator of xml definition of ImageArraySplitGadget.
Definition: gadget_lib.h:598
Class for the generator of xml definition of ImageFinishGadget.
Definition: gadget_lib.h:835
Base class for generators of xml-definitions of image writer gadgets.
Definition: gadget_lib.h:189
Class for GadgetIsmrmrdAcquisitionMessageReader gadget xml-definition generator.
Definition: gadget_lib.h:113
Class for GadgetIsmrmrdAcquisitionMessageWriter gadget xml-definition generator.
Definition: gadget_lib.h:139
Class for MRIImageReader gadget xml-definition generator.
Definition: gadget_lib.h:164
Class for MRIImageWriter gadget xml-definition generator.
Definition: gadget_lib.h:195
Class for the generator of xml definition of NoiseAdjustGadget.
Definition: gadget_lib.h:243
Class for the generator of xml definition of PCACoilGadget.
Definition: gadget_lib.h:257
Class for the generator of xml definition of PhysioInterpolationGadget.
Definition: gadget_lib.h:612
Class for the generator of xml definition of RemoveROOversamplingGadget.
Definition: gadget_lib.h:303
Class for the generator of xml definition of SimpleReconGadget.
Definition: gadget_lib.h:454
Class for xml-definition generator for a simple fully sumpled reconstruction gadget set.
Definition: gadget_lib.h:878
Abstract base class for a gadget xml-definition generator.
Definition: gadget_lib.h:45
Abstract data container.
Definition: GeometricalInfo.cpp:141
bool iequals(const std::string &a, const std::string &b)
Case insensitive string comparison, replaces boost::iequals.
Definition: iequals.cpp:7