-
Notifications
You must be signed in to change notification settings - Fork 95
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
Generate dynamic images #1159
base: master
Are you sure you want to change the base?
Generate dynamic images #1159
Conversation
Use shared_ptr to take single frames from the DynamicDiscretisedDensity.
If there is interest, I have an additional class that can calculate simple types of motion (rotation for now) and refresh the shapes in each time frame. |
In the frame comparison we need to subtract 1 to be consistent
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.
I like it. Just a few comments or concerns.
examples/ROOT_files/ROOT_STIR_consistency/SourceFiles/.generate_image1.par.swp
is a binary file, is it needed?
get_output_sptr() | ||
get_output_sptr(unsigned int frame) | ||
{ | ||
return out_density_ptr; | ||
return out_density_ptr->get_density_sptr(frame); | ||
} | ||
|
||
shared_ptr<DynamicDiscretisedDensity> | ||
GenerateImage:: | ||
get_all_outputs_sptr() | ||
{ | ||
return out_density_ptr; | ||
} |
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.
Why not keep get_output_sptr()
with no arg and add get_output_sptr(unsigned int frame)
method? Maybe this is clearer?
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.
it would be, or actually we wouldn't really need get_output_sptr(frame)
really. However, sadly I cannot see a way to preserve backwards compatibility.
@@ -134,7 +141,9 @@ class GenerateImage : public KeyParser | |||
Succeeded save_image(); | |||
|
|||
//! Returns the discretised density with computed shapes. | |||
shared_ptr<DiscretisedDensity<3, float>> get_output_sptr(); | |||
shared_ptr<DiscretisedDensity<3, float>> get_output_sptr(unsigned int frame = 1); |
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.
It seems like this default might cause problems later?
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.
When do you mean?
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.
Sorry, bad comment. I think I meant it doesn't preserve backways compatability.
It would be of interest, but it'd have to work with the motion stuff in |
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.
Interesting and small. I'm not so sure I like adding frames to the Shape3D
class. It seems frames don't have too much to do with a shape.
Maybe there's a way to change the value
keyword into a TAC? Might be less obvious, but would be quite nice...
out_density_ptr.reset(new DynamicDiscretisedDensity(exam_info_sptr->get_time_frame_definitions(), | ||
rel_start_time, | ||
scn, | ||
tmpl_image) ); | ||
|
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.
I'm astonished that we don't have a constructor for DynamicDiscretisedDensity
that takes an ExamInfo
. That would be far better. Maybe add it in this PR?
@@ -143,6 +145,9 @@ class DynamicDiscretisedDensity: public ExamData | |||
const singleDiscDensT & | |||
get_density(const unsigned int frame_num) const ; | |||
|
|||
shared_ptr<DiscretisedDensity<3, float> > |
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.
I think would need to return shared_ptr<const singleDiscDensT>
: correct template but also prevents modifying the underlying object.
Let's do that for STIR 6.0, i.e. after release of 5.2, as then we can break backwards compatibility as much as we like! Anyone any ideas on adding a TAC to shapes? Ideally would include integration of the TAC for a time-frame. Possibly we can re-use some of the |
Added the simple ability to generate dynamic images based on a .fdef file.
The modifications are simple and backward compatibility is maintained.