From: Eric on 16 Apr 2010 11:11 the help Jeff gave for using DICOMANON is the same as in the help file. I have tried this and while it seems to do what the script says, and the Series and Study IDs seem to be preserved, something isnt kept the same. for example, i use ITK-SNAP (http://www.itksnap.org/). if i load in an image from a series before using DICOMANON as Jeff showed, everything is fine. If I use DICOMANON, the ITK-SNAP software still reads the ID numbers but doesnt see the set of files as part of a series anymore. anyone else having this problem? "Jeff Mather" <jeff.mather(a)mathworks.com> wrote in message <h3ft47$50t$1(a)fred.mathworks.com>... > Hi Cheng, > > DICOM files have a number of unique ID (UID) values that DICOMWRITE will update. In particular, each file you write is being given new "Series Instance UID" and "Study Instance UID" values, which are causing the images to dissociate. In general, this is a very desirable thing, since you won't want DICOMWRITE to reuse the universally unique IDs, accidentally linking images together (and probably getting in the way of truly anonymizing your image files, too). There may be a few other subtle things going on here, but I would bet that for you, the default behavior of DICOMWRITE to generate new UID values actually goes too far. > > You have two options. The first and the best one is to use DICOMANON, a function which makes anonymizing DICOM files very easy. One of the help examples shows how to do exactly what you want: > > % (3) Anonymize a series of images, keeping the hierarchy. > values.StudyInstanceUID = dicomuid; > values.SeriesInstanceseriesUID = dicomuid; > > d = dir('*.dcm'); > for p = 1:numel(d) > dicomanon(d(p).name, sprintf('anon%d.dcm', p), ... > 'update', values) > end > > DICOMANON strips out several privacy-related fields. If that's more than you need or if you only want to change certain fields, you'll need to use the 'CreateMode' parameter of DICOMWRITE, giving it the value 'copy'. This attempts to preserve as much of the metadata as possible. Certain UIDs *must* change, but it should preserve the inter-image relationships. See the examples in the DICOMWRITE help (along with the important warning) for more information. > > Jeff Mather > Image Processing Group > The MathWorks, Inc. > > > Cheng Cosine <asecant(a)gmail.com> wrote in message <f55aa6c0-0a32-4f61-8b7b-e19ae2b28146(a)g1g2000yqh.googlegroups.com>... > > Hi: > > > > I am trying to remove some info contained in dicom file. I tried the > > following script but then some connectivity between images are > > destroyed. For example, originally when I import that set of dicom > > images to Amira, Amira knows that these images are continuous images > > denoting a 3D part of human body. But the new image set generated by > > my script seems to destroy something. The generated images are no > > longer recognized by Amira as a serious of 2D slices together > > represent a 3D human body. Instead, now each image is interpretated as > > a single object. What did I do wrong and how do I correctly generate > > a "clean" image set that do not contain sensitive information? > > > > No = 60; > > > > for n = 1:1:No > > Fname = ['MD.data.', num2str(n, '%4.4i'), '.dcm']; > > X = dicomread(Fname); > > Xinfo = dicominfo(Fname); > > > > info = Xinfo; > > info.InstitutionName = 'Hell Medical Center'; > > info.ReferringPhysicianName = 'DearGod'; > > info.PatientName = 'MD'; > > > > fname = ['ct_file.', num2str(n, '%4.4i'), '.dcm']; > > dicomwrite(X, fname, info); > > end % n loop
From: Jeff Mather on 16 Apr 2010 11:30 "Eric " <remove.this.ncvspurchases.hunter(a)utah.edu> wrote in message <hq9umo$ep5$1(a)fred.mathworks.com>... > the help Jeff gave for using DICOMANON is the same as in the help file. I have tried this and while it seems to do what the script says, and the Series and Study IDs seem to be preserved, something isnt kept the same. > > for example, i use ITK-SNAP (http://www.itksnap.org/). if i load in an image from a series before using DICOMANON as Jeff showed, everything is fine. If I use DICOMANON, the ITK-SNAP software still reads the ID numbers but doesnt see the set of files as part of a series anymore. > > anyone else having this problem? Eric, please feel free to contact me directly via e-mail, and we can get this sorted out. Jeff
From: Jeff Mather on 19 Apr 2010 15:04 Turns out I put a typo in the help example, which I then posted here last year. The correct fields is "SeriesInstanceUID" not "SeriesInstanceseriesUID." Oops! The example should read: % (3) Anonymize a series of images, keeping the hierarchy. values.StudyInstanceUID = dicomuid; values.SeriesInstanceUID = dicomuid; d = dir('*.dcm'); for p = 1:numel(d) dicomanon(d(p).name, sprintf('anon%d.dcm', p), ... 'update', values) end Sorry for any confusion or wasted time. Jeff Mather Image Processing Group MathWorks
|
Pages: 1 Prev: Weighted sampling without replacement Next: Errors and issues with NLINFIT |