Conversation
Along with some simple code to check it all works.
Note there's still an issue with the FFT shift here: this is due to the indexing in the frequency domain, where zero frequency is at index 0, and negative frequencies are in the range above N/2 (where N is the length of the array). To get this right, you'd need to also fix up the handling of this discontinuity at N/2.
Implementation checked against mrdegibbs, results match if shifts are matched and edge frequency is zeroed
This seems to work very slightly better on the phantom
| if (axes == vector<uint32_t> ({ 0, 1, 2 })) { | ||
| // 3D operation: | ||
| // process data and return immediately | ||
| Degibbs::unring3D (in, out, minW, maxW, nshifts); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Consider issuing a WARNING level message if the user has requested 3D operation yet the key-value field SliceDirection is present indicating that the acquisition was in fact 2D.
There was a problem hiding this comment.
Good idea. I think there's probably quite a lot of additional checks we can do here...
From prior discussions I believe that this is the way to go. Could however have |
I think this is probably better.
Is there a problem with the Eigen/Unsupported FFT code? Is there a big difference in run time? I would prefer not to need the extra dependency... |
Yes, I had a feeling that would be the consensus.
Yes, it's considerably slower than FFTW. I really wouldn't recommend using the Eigen FFT code if the FFTW library was available. And it's very widely available on all target platforms, which is why I'm actually pretty comfortable with making it a hard requirement. More to the point: there's a few idiosyncracies between the FFTW Eigen backend and their native backend, which make it a bit fragile to support both - especially when used in multi-threaded apps. I'd rather avoid the headaches....
If there was any suggestion that installing FFTW might be difficult on some platforms, I might consider this. But given how easy it is on all the platforms we target, I'd prefer to keep things simple both for us and our users by making FFTW a hard requirement, and making sure users always have |
|
OK, happy with that. |
Good point, though I don't know that the former should be forbidden;
Haven't looked into ubiquity of the library, so if that's your assessment then 👍 |
|
OK, I think this last commit addresses all the Still to do: tidy up the FFT filter. |
|
Is it intended that |
|
Would it support a single axis as well? |
Command-line entries with a dash then a digit are rejected as command-line option candidates pretty early. We could theoretically ease that restriction by utilising the same trick as in #1794: Take the entry string after the dash(es), attempt to convert to int/float (where crucially the conversion needs to consume the entire string), and if both fail, try interpreting the entry as a command-line option instead. The hidden catch here is that it would no longer be permissible to have command-line options called Generally I think not permitting command-line options to start with digits assists in the visual discrimination between options and values. Though if that were the decision, it might be preferable to catch programmers attempting to add a command-line option that starts with a digit and throw an exception immediately upon interface construction, rather than leading to a parsing error upon use. |
That would be easy to do technically, but would require yet another code path... Is that something you're interested in doing? |
I had a think about how that might work, but it's tricky to get right. The main issue as far as I can tell is making sure we don't trip over ourselves due to option shortening. If we're not careful, the number
Well, the flip-side is that it's not currently possible to use
You mean |
Good point; I'd advocate for avoiding the prospect for that reason. |
3286a26 to
0f4214c
Compare
|
OK, this is almost there.
[EDIT: my mistake, this was already included with 082a832] Otherwise, you'll note I've changed the option to trigger 3D operation from |
|
OK, this is good to go as far as I can tell. I'll merge now... |
First go at merging the 3D unringing capability into
mrdegibbs.Still to do:
-3d), rather than the current-axes 0:2