-
-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add ImageToVideoFilter and accompanying wrappings #2635
ENH: Add ImageToVideoFilter and accompanying wrappings #2635
Conversation
8de6afb
to
5a30133
Compare
Working on resolving upstream CI warnings not appearing on my local platform. EDIT: Looks like warnings are resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbirdso very nice!!
A few comments inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Posted two questions - perhaps they need to be addressed...or ignored...
@tbirdso please ping me after you have addressed the existing reviews. That way I have somewhat fresh eyes updated PR. |
835a456
to
e825084
Compare
Maybe `FrameIndex` (`FrameStart`) and `FrameCount` or `FrameSize`
(`FrameDuration`)? `FrameDuration` in particular seems like it should be
`1/framerate` which sounds like it isn't.
…On Thu, Jul 8, 2021 at 9:41 AM Tom Birdsong ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Modules/Video/Core/include/itkImageToVideoFilter.hxx
<#2635 (comment)>
:
> +//
+template <typename TInputImage, typename TOutputVideoStream>
+void
+ImageToVideoFilter<TInputImage, TOutputVideoStream>::GenerateOutputInformation()
+{
+ // Get the input
+ const InputImageType * input = this->GetInput();
+
+ // Get first input frame's largest possible spatial region
+ InputImageRegionType inputRegion = input->GetLargestPossibleRegion();
+
+ // Set temporal frame + duration from user-defined frame axis in input image
+ OutputTemporalRegionType outputTemporalRegion;
+ outputTemporalRegion.SetFrameStart(inputRegion.GetIndex(m_FrameAxis));
+ outputTemporalRegion.SetFrameDuration(inputRegion.GetSize(m_FrameAxis));
+ // TODO set real start and real duration
Good questions! Responding to the second part, TemporalRegion represents
the region for an entire TemporalObject, with FrameStart corresponding to
the first frame index and FrameDuration representing the number of frames
in the region. This may be easiest to see in iteration such as in
itk::VideoStream
<https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Video/Core/include/itkVideoStream.hxx#L242>
.
RealStart and RealDuration are the corollary to physical origin and
spacing, though again I believe Duration here corresponds to the time
interval across the entire region as opposed to the spacing between frames.
This naming is maybe ambiguous especially when coming from the perspective
of how we handle physical spacing in Images. I'll add clarifying comments.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#2635 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOGPH7ALE6BAFGEOPDTJIUDTWWTI5ANCNFSM474X57GQ>
.
--
Brad T. Moore, Ph.D.
Staff R&D Engineer, Medical Computing
Kitware, Inc.
http://www.kitware.com
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, some comments in line.
8738fce
to
310f561
Compare
467aa8a
to
82e3350
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
Adding
itk::ImageToVideoFilter
to ITKVideoCore module along with baseline test and wrappings.This class serves as a bridge to convert static
itk::Image
objects toitk::VideoStream
representation. The user supplies anitk::Image
input to the filter and designates a single axis to interpret as a temporal axis in the output. WhenUpdate()
is called the filter allocates the outputitk::VideoStream
and grafts slices of the input along its designated axis onto output frames.The goal of adding this filter is to make it easier to use static data sets as test sets for real-time systems making use of
itk::VideoStream
for data collection and representation. The filter is single-threaded and could be revisited to take advantage of multithreading from the baseitk::VideoSource
class at some point in the future.Comments and revisions are welcomed.
@thewtex
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.