Enabled dicom output for MR reconstruction with Gadgetron.
Tested on examples.
Quick fixes #1128.
Please read and adhere to the contribution guidelines.
Please tick the following:
https://github.com/SyneRBI/SIRF/pull/1141
(7 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@KrisThielemans requested changes on this pull request.
best to add a test case for it (if easy)
In src/xGadgetron/cGadgetron/gadgetron_x.cpp:
> @@ -288,6 +296,7 @@ ImagesProcessor::process(const GadgetronImageData& images)
THROW("DICOM writer does not support complex images");
std::string config = xml();
+ std::cout << xml() << '\n';
i guess this has to be removed
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadget_lib.h:
> @@ -356,7 +356,29 @@ namespace sirf {
}
};
- class GenericReconCartesianFFTGadget : public Gadget {
+ class FFTGadget : public Gadget {
+ public:
+ FFTGadget() :
+ Gadget("FFT", "gadgetron_mricore", "FFTGadget")
+ {}
+ static const char* class_name()
+ {
+ return "FFTGadget";
+ }
+ };
+
+ class CombineGadget : public Gadget {
add some doxygen what this is supposed to do
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadget_lib.h:
> @@ -356,7 +356,29 @@ namespace sirf {
}
};
- class GenericReconCartesianFFTGadget : public Gadget {
+ class FFTGadget : public Gadget {
add some doxygen what this is supposed to do
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_x.h:
> @@ -253,7 +253,7 @@ namespace sirf {
return "ImagesReconstructor";
}
- void process(MRAcquisitionData& acquisitions);
+ void process(MRAcquisitionData& acquisitions, const char* dcm_prefix = "image");
I'd prefer to have a set_dcm_prefix or similar function. Adding it as an optional argument is rather non-standard.
In src/xGadgetron/pGadgetron/Gadgetron.py:
> @@ -1435,14 +1435,21 @@ def set_input(self, input_data):
'''
assert isinstance(input_data, AcquisitionData)
self.input_data = input_data
- def process(self):
+ def process(self, dcm_prefix=None):
I'd prefer to have a set_dcm_prefix or similar function. Adding it as an optional argument is rather non-standard.
In src/xGadgetron/pGadgetron/Gadgetron.py:
> '''
Processes the input with the gadget chain.
+ dcm_prefix: Python text string.
+ If dcm_prefix is not None, the reconstructed images are written to
+ files <dcm_prefix>_<image number>.dcm.
+ Otherwise, they are stored in memory and can be retrieved by
Is it really "otherwise", i.e. will get_output() not work? that'd be a pity.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@KrisThielemans pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
failures:
cGT_reconstructImages() missing 1 required positional argument: 'dcm_prefix'Expected output of reconstruction to be complex—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_x.h:
> @@ -253,7 +253,7 @@ namespace sirf {
return "ImagesReconstructor";
}
- void process(MRAcquisitionData& acquisitions);
+ void process(MRAcquisitionData& acquisitions, const char* dcm_prefix = "image");
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/cGadgetron/gadgetron_x.cpp:
> @@ -288,6 +296,7 @@ ImagesProcessor::process(const GadgetronImageData& images)
THROW("DICOM writer does not support complex images");
std::string config = xml();
+ std::cout << xml() << '\n';
sure
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/pGadgetron/Gadgetron.py:
> '''
Processes the input with the gadget chain.
+ dcm_prefix: Python text string.
+ If dcm_prefix is not None, the reconstructed images are written to
+ files <dcm_prefix>_<image number>.dcm.
+ Otherwise, they are stored in memory and can be retrieved by
Yes, unfortunately the set of gadgets in currently used Gadgetron 3.17 does not seem to allow sending images to both the Gadgetron client and DICOM files. I might try to edit DicomFinishGadget so that it sends ISMRMRD images to the client but, assuming I succeed, do we want to ship our modification of Gadgetron with SIRF?
To remind you, this PR is just a quick fix, for a proper one we need help from Gadgetron people, but we can only get it once we moved to the recent Gadgetron.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
> @@ -1435,14 +1435,21 @@ def set_input(self, input_data):
'''
assert isinstance(input_data, AcquisitionData)
self.input_data = input_data
- def process(self):
+ def process(self, dcm_prefix=None):
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@KrisThielemans commented on this pull request.
In src/xGadgetron/pGadgetron/Gadgetron.py:
> '''
Processes the input with the gadget chain.
+ dcm_prefix: Python text string.
+ If dcm_prefix is not None, the reconstructed images are written to
+ files <dcm_prefix>_<image number>.dcm.
+ Otherwise, they are stored in memory and can be retrieved by
ok. as long as it's clear in the documentation. Maybe let get_output() check if the prefix was set, and if so raise a runtime error that's somewhat informative.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadget_lib.h:
> @@ -356,7 +356,29 @@ namespace sirf {
}
};
- class GenericReconCartesianFFTGadget : public Gadget {
+ class FFTGadget : public Gadget {
+ public:
+ FFTGadget() :
+ Gadget("FFT", "gadgetron_mricore", "FFTGadget")
+ {}
+ static const char* class_name()
+ {
+ return "FFTGadget";
+ }
+ };
+
+ class CombineGadget : public Gadget {
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadget_lib.h:
> @@ -356,7 +356,29 @@ namespace sirf {
}
};
- class GenericReconCartesianFFTGadget : public Gadget {
+ class FFTGadget : public Gadget {
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/pGadgetron/Gadgetron.py:
> '''
Processes the input with the gadget chain.
+ dcm_prefix: Python text string.
+ If dcm_prefix is not None, the reconstructed images are written to
+ files <dcm_prefix>_<image number>.dcm.
+ Otherwise, they are stored in memory and can be retrieved by
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@KrisThielemans requested changes on this pull request.
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_x.h:
> @@ -253,15 +253,31 @@ namespace sirf {
return "ImagesReconstructor";
}
+ void set_dcm_prefix(const char* dcm_prefix)
+ {
+ dcm_prefix_ = dcm_prefix;
+ }
+ std::string dcm_prefix() const
+ {
+ return dcm_prefix_;
+ }
+ bool dcm_output() const
+ {
+ return dcm_prefix_.size() > 1;
probably should be >0 I guess, but better to check !dcm_prefix.empty()
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_x.h:
> @@ -253,15 +253,31 @@ namespace sirf {
return "ImagesReconstructor";
}
+ void set_dcm_prefix(const char* dcm_prefix)
+ {
+ dcm_prefix_ = dcm_prefix;
dcm_prefix is not null. Although why do you want a const char*. I'd vastly prefer a const std::string& (it'll auto-convert anyway)In src/xGadgetron/pGadgetron/Gadgetron.py:
> def process(self):
'''
Processes the input with the gadget chain.
+ dcm_prefix: Python text string.
+ If dcm_prefix is not None, the reconstructed images are written to
actually at the moment you set it "", not to None. are both handled the same?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_x.h:
> @@ -253,15 +253,31 @@ namespace sirf {
return "ImagesReconstructor";
}
+ void set_dcm_prefix(const char* dcm_prefix)
+ {
+ dcm_prefix_ = dcm_prefix;
+ }
+ std::string dcm_prefix() const
+ {
+ return dcm_prefix_;
+ }
+ bool dcm_output() const
+ {
+ return dcm_prefix_.size() > 1;
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_x.h:
> @@ -253,15 +253,31 @@ namespace sirf {
return "ImagesReconstructor";
}
+ void set_dcm_prefix(const char* dcm_prefix)
+ {
+ dcm_prefix_ = dcm_prefix;
done
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov commented on this pull request.
In src/xGadgetron/pGadgetron/Gadgetron.py:
> def process(self):
'''
Processes the input with the gadget chain.
+ dcm_prefix: Python text string.
+ If dcm_prefix is not None, the reconstructed images are written to
just forgot to change None (used in my first design) to "", corrected now
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@KrisThielemans approved this pull request.
great. Feel free to merge whenever you're ready (after adding something to CHANGES.md)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@evgueni-ovtchinnikov pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Merged #1141 into master.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()