<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000066">
I forgot to send to the entire mailing list. Here it is again:<br>
<div class="moz-text-html" lang="x-western"><br>
I added f->Load(), but still nothing happens. This is on Windows XP,
using gdcm 1.2.2 downloaded from sourceforge. Here is the new code:<br>
<br>
for (i=0;i<filelist.Count();i++) {<br>
/* open dicom file */<br>
f = new gdcm::File();<br>
f->SetLoadMode(gdcm::LD_ALL);<br>
f->SetFileName(filelist.Item(i).c_str());<br>
/* determine which fields to anonymize */<br>
if (chkPatientName->GetValue())<br>
f->AddAnonymizeElement( 0x0010, 0x0010,
txtPatientName->GetValue().c_str());<br>
if (chkPatientBirthdate->GetValue())<br>
f->AddAnonymizeElement( 0x0010, 0x0030,
txtPatientBirthdate->GetValue().c_str());<br>
if (chkStudyDate->GetValue())<br>
f->AddAnonymizeElement( 0x0008, 0x0020,
txtStudyDate->GetValue().c_str());<br>
if (chkSeriesDate->GetValue())<br>
f->AddAnonymizeElement( 0x0008, 0x0021,
txtSeriesDate->GetValue().c_str());<br>
<br>
if (!f->Load()) {<br>
delete f;<br>
continue;<br>
}<br>
f->AnonymizeNoLoad();<br>
f->ClearAnonymizeList();<br>
/* close the file */<br>
delete f;<br>
}<br>
<br>
-Greg<br>
<br>
<br>
<br>
<br>
Jean-Pierre Roux wrote:
<blockquote cite="mid45338E90.5080904@creatis.univ-lyon1.fr" type="cite">Jean-Pierre
Roux wrote: <br>
<br>
<blockquote type="cite">Greg Book wrote: <br>
<br>
<br>
<br>
<blockquote type="cite">I'm attempting to anonymize a file using
gdcm::File::AnonymizeNoLoad(). I use the following code, but the file
is not anonymized, the file date is not changed either. <br>
What might be happening? <br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
--> OK : my answer may look strange <br>
Please use <br>
<br>
f->Load() <br>
juste before using f->AnonymizeNoLoad() <br>
<br>
This is not a mistake, just a stupid name for AnonymizeNoLoad : <br>
NoLoad was *not* "don't load the file header", but "don't load the
pixels in memory". <br>
The right name should be : AnonymizeNoGetData <br>
<br>
<br>
Jean-Pierre Roux <br>
<br>
<blockquote type="cite">
<blockquote type="cite">Thanks, <br>
Greg <br>
<br>
/* open dicom file */ <br>
f = new gdcm::File(); <br>
f->SetLoadMode(gdcm::LD_ALL); <br>
f->SetFileName(filelist.Item(i).c_str()); <br>
<br>
</blockquote>
<br>
I'm not on my PC, and I cannot check, but I think you should Load the
gdcm::File here. <br>
<br>
if ( !f->Load() ) <br>
{ <br>
std::cout << "[" << fileName << "] is not a
gdcm-readable file" <br>
<< std::endl; <br>
f->Delete(); <br>
return 1; <br>
} <br>
<br>
(Have a look at Example/AnonymizeNoLoad.xx) <br>
HTH <br>
Jean-Pierre Roux <br>
<br>
<br>
<br>
<blockquote type="cite"> /* determine which fields to
anonymize */ <br>
if (chkPatientName->GetValue()) <br>
f->AddAnonymizeElement( 0x0010, 0x0010,
txtPatientName->GetValue().c_str()); <br>
if (chkPatientBirthdate->GetValue()) <br>
f->AddAnonymizeElement( 0x0010, 0x0030,
txtPatientBirthdate->GetValue().c_str()); <br>
if (chkStudyDate->GetValue()) <br>
f->AddAnonymizeElement( 0x0008, 0x0020,
txtStudyDate->GetValue().c_str()); <br>
if (chkSeriesDate->GetValue()) <br>
f->AddAnonymizeElement( 0x0008, 0x0021,
txtSeriesDate->GetValue().c_str()); <br>
/* close the file */ <br>
f->AnonymizeNoLoad(); <br>
f->ClearAnonymizeList(); <br>
delete f; <br>
<br>
------------------------------------------------------------------------
<br>
<br>
_______________________________________________ <br>
Dcmlib mailing list <br>
<a class="moz-txt-link-abbreviated"
href="mailto:Dcmlib@creatis.insa-lyon.fr">Dcmlib@creatis.insa-lyon.fr</a>
<br>
<a class="moz-txt-link-freetext"
href="http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib">http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib</a>
<br>
<br>
<br>
</blockquote>
_______________________________________________ <br>
Dcmlib mailing list <br>
<a class="moz-txt-link-abbreviated"
href="mailto:Dcmlib@creatis.insa-lyon.fr">Dcmlib@creatis.insa-lyon.fr</a>
<br>
<a class="moz-txt-link-freetext"
href="http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib">http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib</a>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</div>
</body>
</html>