Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DICOM Translator

Posted on 2003-12-04
12
Medium Priority
?
493 Views
Last Modified: 2012-03-15
I have a DICOM (CT IMage) and i need to extract the text information (HEADER).

I need to get each specific byte for it to work.

Can you help me, The relevant info is here http://www.psychology.nottingham.ac.uk/staff/cr1/dicom.html this will show you where the bytes are, and i can email you a dicom file if you require, but i believe therre are some downloadable ones there.

Just for sake i want in this demo to extract 0010,0010 (Patient Name)  ONLY, by clicking a button, for it to open the file, and get info.

PLEASE HELP.




0
Comment
Question by:bolox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 1

Author Comment

by:bolox
ID: 9873892
If you need a dicom file, please ask and i will email you one.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9874023
Read the whole file

ie

    Dim ff As Integer, Filename As String, s As String
   
    Filename = "Yourfile"
    ff = FreeFile
    Open Filename For Binary Access Read Lock Read Write As #ff
    s = Space$(LOF(ff))
    Get #ff, , s
    Close ff

    dim Arr, I as long
    arr = split(s, vbcrlf)
    for i=0 to ubound(arr)
         if (instr(arr(i), "0010,0010") then
               ' Find the line extra data from here
              exit for
         endif
    next
    erase arr
0
 
LVL 1

Author Comment

by:bolox
ID: 9874212
This does not search through the file? IF i put un unknow file in, it does not give an error,

Could you put the result into a text field so that i can see what is has found?? and maybe put a limiter on it to say....

Display everything between 0010,0010 and 0011,0011 for example.

I WILL offer more pooints, i am waiting for some deleted question points to come my way.

Thanx
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:bolox
ID: 9874240
if yo ugive me your email address i will email you a Dicom file, That way you can see what i am dealing with, (My question is a bit confusing now i think about it)

0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9874264
eddykwan2003@yahoo.com
0
 
LVL 5

Expert Comment

by:mccainz2
ID: 9874280
Have you investigated the numerous DICOM reader controls and librarys available for DICOM manipulation. I use LeadTools medical imaging suite for our applications....Its costly though $8k for the full suite (2 month free eval though).  Doing this by hand will be difficult unless you are positive regarding the modality of your images (Tomagraph,Intraoral-pano, etc....) otherwise byte position will be extremely variable.

0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9874389
>>Just for sake i want in this demo to extract 0010,0010 (Patient Name)  ONLY, by clicking a button, for it to open the file, and get info.


>>Display everything between 0010,0010 and 0011,0011 for example

Which one you want?
You don't even has 0011,0011  in the file?
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 260 total points
ID: 9874425
Option Explicit

Private Sub Command1_Click()
Dim ff As Integer, Filename As String, s As String
   
   Filename = "c:\temp\tt.txt"
   If (Dir(Filename) = "") Then
    MsgBox "file doesn't exist"
    Exit Sub
End If
   ff = FreeFile
   Open Filename For Binary Access Read Lock Read Write As #ff
   s = Space$(LOF(ff))
   Get #ff, , s
   Close ff

   Dim Arr, I As Long
   Arr = Split(s, vbCrLf)
   For I = 0 To UBound(Arr)
        If (InStr(Arr(I), "0010,0010")) Then
            MsgBox Mid(Arr(I), InStr(1, Arr(I), "=") + 1, Len(Arr(I)))
              ' Find the line extra data from here
             Exit For
        End If
   Next
   Erase Arr

End Sub
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9874476
It is very difficult to work with DICOM files from scratch. Even if you succeed to extract some information from some specific file, this way may fail on another file.
When you will get some result, try it on variuos files from here:
http://www.barre.nom.fr/medical/samples/

See also list of DICOM programs on this page. Usually they are developed in C or C++ and not VB.
For full solution I suggest you to use some third-party tool, which supports COM interface and available for VB developer. This is one of the best (and costs a lot of money,unfortualtely):

http://www.leadtools.com/home2/techcat/ltprodfeatures.htm
0
 
LVL 1

Author Comment

by:bolox
ID: 9881833
Sorry to be a pain, But it is in HEX format??

Can you still help.????

It starts at 504E0C00 (String 3BD) and continues to 100020

Any Ideas?
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10267425
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/Refund
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

leonstryker
EE Cleanup Volunteer
0
 
LVL 1

Author Comment

by:bolox
ID: 10269476
Thankyou for all of your help, sory for the delay in responding.

Regards

Bolox

AKA Gavin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question