.dat file image generation and analysis
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
I have a current need to undertake image analysis and have the following query. I have .dat file containing an industrial X-Ray image with 16 bit greyscale range values. The .dat file contains values for each pixel in the 250 x 439 image size. My question, as a non-user and novice in this area, is if Matlab can be used to create a visual image from the .dat file and be used for analysis? Any links or suggested learning documentation in this area would be most welcome.
採用された回答
Neuropragmatist
2019 年 9 月 9 日
Matlab has countless ways to visualise images loaded into the workspace.
The problem with your file is that .dat sounds like a generic file type and Matlab won't know how to load it. Do you know if the file has an underlying file type like .tiff? Or can you convert your .dat file to an image or text file? What program do you normally use to view your .dat files?
If you upload one of your files we might be able to take a closer look.
M.
8 件のコメント
David Comiskey
2019 年 9 月 9 日
Thanks for your answer. I am not aware of the underlying file type - I am hoping to be able to convert the contents of the .dat file to an image.
What the .dat contains is 16-bit greyscale values for each pixel in an X-Ray image. I am wanting to convert this from a collection of numeric values into an image which can be viewed. I have attached one of the .dat files.
Neuropragmatist
2019 年 9 月 9 日
I don't see the file David, where did you upload it?
M.
David Comiskey
2019 年 9 月 9 日
Apologies, please see previous comment with hyperlink now shown.
Neuropragmatist
2019 年 9 月 9 日
Hi David, I think you have uploaded that to your university (OneDrive?) directory, which I don't have access to. You will have to either make it accessible to people outside your campus and university network or upload it somewhere else, like Google drive.
Or just click 'attachments' when you are writing a comment and upload it directly on this site.
M.
David Comiskey
2019 年 9 月 9 日
The above link shoud work as the access preferences have been amended. It wont allow me up attach a .dat file for some reason!
Neuropragmatist
2019 年 9 月 9 日
編集済み: Neuropragmatist
2019 年 9 月 9 日
OK, I was expecting to have to go digging around but the first thing I tried actually worked. I just passed the file to Matlab's inbuilt 'importdata' function and it does fine to load your file. From there plotting it is really easy:
img = importdata('Ulster Univ Cladding _Insul Samples_20_summed.dat');
% img is a matrix that seems to just be your image
% some plotting routines
figure
subplot(2,2,1)
imagesc(img) % imagesc is the easiest and one of the most commonly used
daspect([1 1 1])
colormap(gca,gray) % using a gray colormap for grayscale makes sense
caxis([intmin('uint16') intmax('uint16')]) % I scale the colormap for what should be
% the min and max value of your image (min possible uint16 value to max possible uint16 value)
title('imagesc, gray')
subplot(2,2,2)
imagesc(img)
daspect([1 1 1])
colormap(gca,jet)
title('imagesc, jet') % same thing as above with the more fondly used jet colormap
caxis([intmin('uint16') intmax('uint16')])
subplot(2,2,3)
imshow(img,[intmin('uint16') intmax('uint16')]) % imshow is a similar function
daspect([1 1 1])
title('imshow for uint16')

I've included just a couple of different ways to plot the data here, I'll let you explore around for what suits you best.
Hope this helps,
M.
Edit: also I just remembered that you mentioned image analysis. In the code above 'img' is a matrix that contains your x-ray image. In the above code I have just plotted it graphically, but you can also apply image analysis techniques to this matrix if you like:
David Comiskey
2019 年 9 月 9 日
Thanks so much, that is perfect. It gives me confidence that this is the way to go. Time to get trained up in Matlab!
Neuropragmatist
2019 年 9 月 9 日
Cool, glad to help.
M.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Red についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
