1. Message box when a file can't be read by ezdicom.ocx
I mixed some files in my directory which are not dicom-
compliant.
Therefore the ezDicom.ocx has to fail. Unfortunately it
does by showing a message box like:
Is there an option to switch off message boxes?
I would prefer a fucntion to test a file. Probably like
Me.ezDicom1.DCMFilename =
"D:\Data\Archive\0007\Study01\Series01\NM001.dcm"
If Err.Number = XXXX then
'Not a DICOM-compliant file
Endif
This would prevent from displaying the message box
within the application.
2. Header Tags
In my application I want to show the header and some
tags. I found a solution to write the header in a temp-
file, to read this file in a string, to kill the temp-file
immediately and then to parse the string. It works but is
a little bit slow. Therefore it would be easier if there
were functions which
a) write the header in a string variable :
strHeader = Me.ezDicom1.DCMWriteHeader2String()
b) Return a specified Tag:
strPatName = Me.ezDicom1.HeaderTag
("0010", "0010").Value
Alternatively
strPatName = Me.ezDicom1.HeaderTag("Patient's
Name").Value
3. Create a new Dicom-file
There are some situations where I would like to create a
new Dicom file with some parameters. I should have the
possibility to add a picture and some tags. For example:
Dim objDic As ezDICOMax.ezDICOMX
Set objDic = New ezDICOMax.ezDICOMX
objDic.Image = "d:\data\image01.jpg"
'Add some header tags
objDic.HeaderTag.AddNew ("0010", "0010")
= "Rorden^Chris"
objDic.HeaderTag.AddNew ("File Meta Elements Group
Len") = "1024"
'Write the Dicom picture to the file
objDic.WriteFile "d:\data\archive\0007\Study01
\Series02\SC0001.dcm"
'Show the image on the screen
Set me.ezDicom1 = objDic
Set objDic = Nothing
4. Change a Header Tag
According to the code above, a Header Tag could be
changed like
objDic.HeaderTag ("0010", "0010") = "Rorden^Chris"
objDic.HeaderTag ("File Meta Elements Group Len")
= "1024"
You added a VB.NET example. Unfortunately I do net yet
work with .NET
but with VB6. Therefore I added my example. Of course
it is freeware
too...
BTW: Every time I want to save or to start the VB6
application I first get the message "unable to find file". I
do not know why.
Demo of ezDicon in VB6