How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Quite a regular
![]()
Joined:
2010/1/6 11:51 Group:
Registered Users Posts:
22
Level : 3; EXP : 41
HP : 0 / 60 MP : 7 / 609 ![]() |
To view this post, you must login and reply first.
Posted on: 2010/1/7 11:11
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Core Team Member
![]()
Joined:
2005/9/15 8:27 From Bangalore, INDIA
Group:
Webmasters Registered Users Core Developers Content Owners Posts:
117
Level : 9; EXP : 84
HP : 0 / 221 MP : 39 / 5014 ![]() |
Hi User, Use DVTkHighLevelInterface dll as reference and implement following code: public int readDicomFile(string filePath) try { } catch() { ............ } } Through Catch you can see the exception if it's not a DICOM file. Get back to us for any further query. Regards, Piyush
Posted on: 2010/1/8 7:41
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Just popping in
![]()
Joined:
2010/1/8 15:45 Group:
Registered Users Posts:
2
Level : 1; EXP : 2
HP : 0 / 0 MP : 0 / 6 ![]() |
Hi,
I have the same question (how to detect that a file is dicom file). I developed myself also the suggested solution, but also .gif. exe and even .doc file are read as it was a dicom file .So this solution is not solid enough. Anyone another suggestions Klaasjan
Posted on: 2010/1/8 15:50
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Core Team Member
![]()
Joined:
2005/9/15 8:27 From Bangalore, INDIA
Group:
Webmasters Registered Users Core Developers Content Owners Posts:
117
Level : 9; EXP : 84
HP : 0 / 221 MP : 39 / 5014 ![]() |
Hi, Can you pl send me your code? We are already implementing the suggested solution in our tools. i'll analyze the issue. Regards, Piyush
Posted on: 2010/1/11 7:35
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Quite a regular
![]()
Joined:
2010/1/6 11:51 Group:
Registered Users Posts:
22
Level : 3; EXP : 41
HP : 0 / 60 MP : 7 / 609 ![]() |
Hi Piyush,
Thanks for the reply, Your solution is really work for me. Now my this problem is solved. Thanks Manesh
Posted on: 2010/1/15 14:50
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Quite a regular
![]()
Joined:
2010/3/23 15:01 Group:
Registered Users Posts:
24
Level : 3; EXP : 62
HP : 0 / 65 MP : 8 / 622 ![]() |
***
i am writing this message to have access to view the first message ***
Posted on: 2010/4/21 9:53
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Quite a regular
![]()
Joined:
2010/1/29 15:36 Group:
Registered Users Posts:
17
Level : 2; EXP : 86
HP : 0 / 46 MP : 5 / 460 ![]() |
Hi Piyush,
any news/suggestions regarding the issue that "also .gif .exe and even .doc file are read as it was a dicom file"? In my implementation also DVTK dlls are correctly read! Thanks in advance.
Posted on: 2010/7/22 9:57
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Webmaster
![]()
Joined:
2005/6/21 15:06 Group:
Webmasters Registered Users Core Developers Content Owners Steering Committee Members Services Request Listeners Webinar organisation Posts:
249
Level : 14; EXP : 75
HP : 0 / 343 MP : 83 / 8034 ![]() |
Hi Sara,
besides checking for an exception thrown, also look at the following property: dcFile.FileMetaInformation.DicomPrefix. This should be the four bytes "DICM" in case of a DICOM file. Regards, Marco
Posted on: 2010/7/26 13:49
|
|
|
_________________
HUMIQ Healthcare Interoperability expertise Centre |
||
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Quite a regular
![]()
Joined:
2010/1/29 15:36 Group:
Registered Users Posts:
17
Level : 2; EXP : 86
HP : 0 / 46 MP : 5 / 460 ![]() |
Hi Marco,
thank you very much for your suggestion. I tried it, but I'm not sure to have correctly understood. In fact: I checked the value of dcFile.FileMetaInformation.DicomPrefix when reading both a DICOM file and a DLL file. In both cases it's a byte array containing the following four byte elements: '68', '73', '67', '77'. Where am I wrong? I thank you in advance for your kind help! Sara.
Posted on: 2010/8/25 11:58
|
|
Transfer
|
||
Re: How to check image is dicom (.dcm) or not in DVTK api's or in .net |
||
|---|---|---|
|
Webmaster
![]()
Joined:
2005/6/21 15:06 Group:
Webmasters Registered Users Core Developers Content Owners Steering Committee Members Services Request Listeners Webinar organisation Posts:
249
Level : 14; EXP : 75
HP : 0 / 343 MP : 83 / 8034 ![]() |
Hi Sara, But this won't help you right now. What you could also try of course is the following. According to part 10, a valid DICOM file should always start with the following:
A fixed 128 byte field available for Application Profile or implementation specified use. If not used by an Application Profile or a specific implementation all bytes shall be set to 00H.
File-set Readers or Updaters shall not rely on the content of this Preamble to determine that this File is or is not a DICOM File.
Four bytes containing the character string "DICM". This Prefix is intended to be used to recognize that this File is or not a DICOM File.
So if you Open a file using the normal Microsoft .Net classes and you inspect bytes 129-132 if they equal DICM, you can determine whether you're dealing with a DICOM file or not.
Please let me know if this solution works for you. Regards,
Posted on: 2010/9/9 15:22
|
|
Transfer
|
||





Transfer


