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

Anonymization fails for RP-files #82

Open
Kiragroh opened this issue Nov 14, 2020 · 1 comment
Open

Anonymization fails for RP-files #82

Kiragroh opened this issue Nov 14, 2020 · 1 comment

Comments

@Kiragroh
Copy link

Kiragroh commented Nov 14, 2020

Hi Rex,

thanks for EvilDICOM. I love to use it.

Sadly, I run into a problem today. I want to build a standalone DICOM-Anonymizer (inspired by 'Varian-Code-Samples/webinars & workshops/Developer Workshop 2014/guru track projects/DICOM Anonymizer' but without Eclipse).

I used the EvilDicom-Example-Code and it works for CT-, RD- and RS-files but not for RP-files. Can you please assist?
I get an enumeration error but it makes no sense. Something strange with the queue.

Here are test files for you:
https://www.dropbox.com/sh/9x8x3384jayw4ox/AAAC24b_l1JhGyz3M1y3WD3Na?dl=0

Here is the relevant CodeSnippet:
private void AnonymizeButton_Click(object sender, RoutedEventArgs e)
{

        //string dir = currentFolderPath;
        string dir = @"C:\Users\m\Desktop\_test";

        string [] toAnonymize = Directory.GetFiles(dir);
        
        var settings = EvilDICOM.Anonymization.Settings.AnonymizationSettings.Default;
        //Change mapping but keep connections
        settings.DoAnonymizeUIDs = true;
        settings.DoAnonymizeStudyIDs = true;
        settings.DoRemovePrivateTags = true;
        settings.DoAnonymizeNames = true;
        settings.FirstName = "";
        //settings.LastName = LastNameTextBox.Text;
        //settings.Id = patientIdTextBox.Text;

        //Gets a current list of UIDs so it can create new ones 
        var queue = EvilDICOM.Anonymization.AnonymizationQueue.BuildQueue(settings, toAnonymize);

        foreach (string file in toAnonymize)
        {
            //ShowLogMsg("Anonymizing "+ file);
            var dcm = EvilDICOM.Core.DICOMObject.Read(file);
            queue.Anonymize(dcm);
            //Write back to initial location - though this can be a different place
            dcm.Write(file.Replace(dir, @"C:\Users\m\Desktop\_anon"));
        }
    }

Best regards
Max

@Kiragroh
Copy link
Author

I solved my problem by going back to version 2.0.5.5. All future versions have the problem.

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

1 participant