-
Notifications
You must be signed in to change notification settings - Fork 497
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: Create roles instead of hard-coded DICOM display fields #963
ENH: Create roles instead of hard-coded DICOM display fields #963
Conversation
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.
Thank you, this looks great. I've just added a couple of mostly trivial comments.
Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.cpp
Outdated
Show resolved
Hide resolved
Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.cpp
Outdated
Show resolved
Hide resolved
Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.cpp
Outdated
Show resolved
Hide resolved
65b8ad0
to
8d16d91
Compare
Comment here if the code is ready for review (and remove "WIP" from the subject). |
8d16d91
to
da49319
Compare
I wanted to do some more extensive testing first. Everything seems good, so if you agree then it's ready to be merged. |
One thing I am still thinking about is the best way to update the displayed fields after removing entries from the database. I created a ticket for it where we can discuss this: This work is not in the scope of this PR, I was just thinking ahead because now I have a pretty good understanding about how these displayed fields work, and when I get to doing the update on removal it will be old memory. |
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.
Fix the typo in the commit message (roles->rules). I've also added a few trivial comments. After these are fixed it is ready to be merged.
Libs/DICOM/Core/ctkDICOMDatabase.cpp
Outdated
@@ -3070,7 +2970,8 @@ void ctkDICOMDatabase::updateDisplayedFields() | |||
Q_D(ctkDICOMDatabase); | |||
|
|||
// Get the files for which the displayed fields have not been created yet (DisplayedFieldsUpdatedTimestamp is NULL) | |||
//TODO: handle cases when the values actually changed; now we only cover insertion and schema update | |||
// Note: The per-instance update only covers insertion and schema update. If fields on the series/study/patient level need to be | |||
// updated on the insertion of a new instance, then it can be handled using the startUpdate/endUpdate functions of the roles. |
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.
// updated on the insertion of a new instance, then it can be handled using the startUpdate/endUpdate functions of the roles. | |
// updated on the insertion of a new instance, then it can be handled using the startUpdate/endUpdate functions of the rules. |
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.
Apparently I made this mistake at many places, including the branch name and commit message. I fixed them all except for the branch name.
ctkDICOMDatabase* DICOMDatabase; | ||
}; | ||
#endif |
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 all the lines are marked as changed?
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.
Not sure why line endings in some files are converted to Windows style. Thanks for noticing.
There are DICOM display fields that do not concern only one instance, but a higher level such as series (number of images), study (number of series), or patient (last study date, number of studies). These fields were calculated using hard-coded functions. Now these have their own rule classes that do the necessary processing in their endUpdate functions.
da49319
to
be87628
Compare
I made the changes. Please merge if there is nothing else. Thank you! |
There are DICOM display fields that do not concern only one instance, but a higher level such as series (number of images), study (number of series), or patient (last study date, number of studies). These fields were calculated using hard-coded functions. Now these have their own role classes that do the necessary processing in their endUpdate functions.