|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
A Question whose responses are screenshot image files. More...
#include <mitkScreenshotQuestion.h>


Public Member Functions | |
| ~ScreenshotQuestion () override | |
| Virtual destructor. More... | |
| std::string | GetType () const override |
| Return the type string "Screenshot". More... | |
| Question * | CreateAnother () const override |
| Create a new default-constructed ScreenshotQuestion instance. More... | |
| void | FromJSON (const nlohmann::ordered_json &j) override |
| Deserialize this ScreenshotQuestion from JSON. More... | |
| void | ToJSON (nlohmann::ordered_json &j) const override |
| Serialize this ScreenshotQuestion to JSON. More... | |
| std::vector< std::string > | GetResponsesAsStrings () const override |
| Return the screenshot file paths as strings. More... | |
| void | ClearResponses () override |
| Clear all screenshot responses. More... | |
| bool | IsComplete () const override |
| Check whether at least one screenshot has been taken. More... | |
| bool | HasFileResponses () const override |
Always returns true since responses are file paths. More... | |
| std::vector< fs::path > | SubmitFileResponses (const fs::path &basePath) const override |
| Copy screenshot files to a "screenshots" subdirectory and return relative paths. More... | |
| void | AddScreenshot (const fs::path &path) |
| Add a screenshot file path as a response. More... | |
| void | RemoveScreenshot (const fs::path &path) |
| Remove a screenshot response and delete the file from disk. More... | |
Public Member Functions inherited from mitk::Forms::Question | |
| Question () | |
| Default constructor. More... | |
| virtual | ~Question () |
| Virtual destructor. More... | |
| std::string | GetQuestionText () const |
| Get the literal question text. More... | |
| void | SetQuestionText (const std::string &question) |
| Set the literal question text. More... | |
| bool | IsRequired () const |
| Check whether a response to this question is required to complete a form. More... | |
| void | SetRequired (bool required=true) |
| Set whether a response to this question is required to complete a form. More... | |
| virtual std::string | GetRequiredText () const |
| Get the text that should be displayed to clearly mark a question as required. More... | |
A Question whose responses are screenshot image files.
Users can take screenshots of render windows as responses. The screenshots are stored as temporary PNG files. During submission, the files are copied to a "screenshots" subdirectory relative to the CSV output path.
Definition at line 31 of file mitkScreenshotQuestion.h.
|
override |
Virtual destructor.
| void mitk::Forms::ScreenshotQuestion::AddScreenshot | ( | const fs::path & | path | ) |
Add a screenshot file path as a response.
The screenshot is only added if the file at the given path exists.
| [in] | path | The file path of the screenshot image. |
|
overridevirtual |
Clear all screenshot responses.
Implements mitk::Forms::Question.
|
overridevirtual |
Create a new default-constructed ScreenshotQuestion instance.
Implements mitk::Forms::Question.
|
overridevirtual |
Deserialize this ScreenshotQuestion from JSON.
| [in] | j | The JSON object to deserialize from. |
Implements mitk::Forms::Question.
|
overridevirtual |
Return the screenshot file paths as strings.
Implements mitk::Forms::Question.
|
overridevirtual |
Return the type string "Screenshot".
Implements mitk::Forms::Question.
|
overridevirtual |
Always returns true since responses are file paths.
true. Reimplemented from mitk::Forms::Question.
|
overridevirtual |
Check whether at least one screenshot has been taken.
true if at least one screenshot path is stored, false otherwise. Implements mitk::Forms::Question.
| void mitk::Forms::ScreenshotQuestion::RemoveScreenshot | ( | const fs::path & | path | ) |
Remove a screenshot response and delete the file from disk.
If the path was among the stored responses and the file exists on disk, the file is deleted. Filesystem errors during deletion are silently ignored.
| [in] | path | The file path of the screenshot to remove. |
|
overridevirtual |
Copy screenshot files to a "screenshots" subdirectory and return relative paths.
Creates a "screenshots" subdirectory under basePath if it does not exist, copies the screenshot files there, and returns paths relative to basePath.
| [in] | basePath | The base directory for the submission output. |
Reimplemented from mitk::Forms::Question.
|
overridevirtual |
Serialize this ScreenshotQuestion to JSON.
| [out] | j | The JSON object to serialize into. |
Implements mitk::Forms::Question.