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

Deleting multiple patients #40

Closed
jakublaznovsky opened this issue Oct 18, 2019 · 3 comments
Closed

Deleting multiple patients #40

jakublaznovsky opened this issue Oct 18, 2019 · 3 comments

Comments

@jakublaznovsky
Copy link

Hello,
thanks for developing Pulmonary Toolkit.
Maybe, I just did something wrong while importing the data, but every single slice from the measurement imported as an individual patient. So the result is about 200 imported patients in patient browser. Is there any possibility how to delete multiple patients in one operation? Or an option to reset all settings of PTK?
Thank you in advance.

@tomdoel
Copy link
Owner

tomdoel commented Oct 19, 2019

Hi,

One common reason this can happen is if the Patient ID tag has been removed, or is not the same for each slice - these most likely occur due to an anonymisation process not being correctly configured. PTK needs the Patient ID to be present and the same on each slice. If thats not the case the tags can be added or corrected using a Dicom edit tool eg Horos or DicomBrowser. You would then need to delete the datasets from PTK and re-import them.

To delete multiple patients:
You can use the API to delete multiple patients by deleting each series for each patient. The DeleteDatasets() call on a PTKMain() object takes in a cell array which are the series uids to delete. For example the following script will delete every patient and every series:

ptk_main = PTKMain();

% Delete all series for all subjects
all_uids = ptk_main.FrameworkAppDef.GetFrameworkDirectories().GetUidsOfAllDatasetsInCache();
ptk_main.DeleteDatasets(all_uids); 

To completely reset PTK and delete all your imported data, edits and results:

  • Close Matlab
  • (Backup, if you want) and then delete the TDPulmonaryToolkit folder in your home directory (Warning: this will delete all your imported data, all results, all manual segmentations, all markers, etc)

Keyboard Shortcut for deleting a single series:
The Delete key will delete the currently loaded series

@jakublaznovsky
Copy link
Author

Hello Tom,
Thank you for an exhaustive answer. You are right that I've imported badly anonymised Dicom data. Whole patients database was deleted via your code, Dicom data was properly configured, and everything works perfectly! Thanks

@tomdoel
Copy link
Owner

tomdoel commented Oct 20, 2019

Thank you for your comments. I'm glad everything is working!

@tomdoel tomdoel closed this as completed Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants