Skip to content
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: Reduce memory usage of DICOM indexer #887

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

lassoan
Copy link
Member

@lassoan lassoan commented Oct 15, 2019

Allow defining cached tags that are not stored in the DICOM tag cache by value. This prevents excessive memory usage and file reading for tags that are not appropriate to store in the tag cache (such as pixel data) but it is still possible to query if the tag is present.

Force updating the database after a certain number of files are parsed. This limits the total memory usage, which could grew big when hundreds of thousands of files were parsed in one batch.

Do not show all series when the browser is initially shown, as this can take significant amount of time when a large database is loaded.

@@ -198,6 +199,13 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDatabase : public QObject
void setTagsToPrecache(const QStringList tags);
const QStringList tagsToPrecache();

/// \brief Tags that must not be stored in the tag cache.
/// Tag may be excluded from storage if it is not suitable for storage in the database or it is usually too large.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... or it is usually -> ...or if it is usually

@@ -198,6 +199,13 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDatabase : public QObject
void setTagsToPrecache(const QStringList tags);
const QStringList tagsToPrecache();

/// \brief Tags that must not be stored in the tag cache.
/// Tag may be excluded from storage if it is not suitable for storage in the database or it is usually too large.
/// Presence of non-empty tag can be still checked using instanceValueExists or fileValueExists.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be still checked -> can be still be checked

Q_INVOKABLE QString instanceValue (const QString sopInstanceUID, const QString tag);
Q_INVOKABLE QString instanceValue (const QString sopInstanceUID, const unsigned short group, const unsigned short element);
Q_INVOKABLE QString fileValue (const QString fileName, const QString tag);
Q_INVOKABLE QString fileValue (const QString fileName, const unsigned short group, const unsigned short element);
Q_INVOKABLE bool tagToGroupElement (const QString tag, unsigned short& group, unsigned short& element);
Q_INVOKABLE QString groupElementToTag (const unsigned short& group, const unsigned short& element);

/// \brief Check if an element with the given attribute tag exists in the dataset and has a non-empty value.
/// @param sopInstanceUID A string with the uid for a given instance
/// (corresponding file will be found via database)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

via database -> via the database

Allow defining cached tags that are not stored in the DICOM tag cache by value. This prevents excessive memory usage and file reading for tags that are not appropriate to store in the tag cache (such as pixel data) but it is still possible to query if the tag is present.

Force updating the database after a certain number of files are parsed. This limits the total memory usage, which could grew big when hundreds of thousands of files were parsed in one batch.

Fixed updating existing images (identified by SOPInstanceUID) when they are loaded from a different file.

Do not show all series when the browser is initially shown, as this can take significant amount of time when a large database is loaded.
@lassoan lassoan force-pushed the reduce-dicom-memory-usage branch from 0341a57 to f91a647 Compare October 15, 2019 22:18
@lassoan lassoan merged commit b4a1546 into commontk:master Oct 15, 2019
@lassoan
Copy link
Member Author

lassoan commented Oct 15, 2019

Thank you, I've fixed the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants