f



reading raw image data into frames

I have exported the image frames as .dat (raw data) or .asc format. I do know all the image data are located in the raw data. I imported the .dat file and I could not see the information in MATLAB. I did it with avi format but I want the program to be written for .dat format. I would like to read the file and display the image frames in my GUI and navigate frame by frame.

Any idea... please share your ideas. 
0
Krishna
9/8/2010 9:41:19 PM
comp.soft-sys.matlab 211067 articles. 13 followers. lunamoonmoon (258) is leader. Post Follow

11 Replies
880 Views

Similar Articles

[PageSpeed] 31

"Krishna " <sathishkrishna12@gmail.com> wrote in message <i68vtv$4de$1@fred.mathworks.com>...
> 
> I have exported the image frames as .dat (raw data) or .asc format. I do know all the image data are located in the raw data. I imported the .dat file and I could not see the information in MATLAB. I did it with avi format but I want the program to be written for .dat format. I would like to read the file and display the image frames in my GUI and navigate frame by frame.
> 
> Any idea... please share your ideas. 

Use fread() and your knowledge of the frame size to read in the raw data.
0
9/8/2010 9:57:04 PM
On 08/09/10 4:41 PM, Krishna wrote:
>
> I have exported the image frames as .dat (raw data) or .asc format. I do
> know all the image data are located in the raw data. I imported the .dat
> file and I could not see the information in MATLAB. I did it with avi
> format but I want the program to be written for .dat format. I would
> like to read the file and display the image frames in my GUI and
> navigate frame by frame.

There are an indefinite number of incompatible .dat formats. Saying that 
you imported the .dat file doesn't give me much confidence that you read 
it in a way that Matlab would be able to understand the data.

We are going to need more information about how you wrote the .dat file 
and how you are trying to read the file, and what results you are seeing.
0
Walter
9/8/2010 10:06:45 PM
Then just write them as a standard image format, like PNG, TIFF, or
something.  Why are you using .dat????  What possible reason do you
have for doing that?
0
ImageAnalyst
9/8/2010 10:23:33 PM
Well, I have the detailed information of the image frames (for ex,  frame rate, exposure time, etc.) from the custom code. If I export the recorded movie as avi, say 500 frames,  I personally think I am gonna lose all the data integrated with the the movie. Exporting .dat (raw data) file or .asc willl have all necessary information about recorded image frames or movie. 

I have tried to read the .dat or .asc file using fopen and fread commands, but this pop out a memory incompatible message. I would like to read the file in the matlab. It could be nice if I am able to read the data from .asc or .dat and pull out the images. This way I can write the code to pull out the acquisition details from the file. 


Walter Roberson <roberson@hushmail.com> wrote in message <VNTho.66316$co1.56745@newsfe11.iad>...
> On 08/09/10 4:41 PM, Krishna wrote:
> >
> > I have exported the image frames as .dat (raw data) or .asc format. I do
> > know all the image data are located in the raw data. I imported the .dat
> > file and I could not see the information in MATLAB. I did it with avi
> > format but I want the program to be written for .dat format. I would
> > like to read the file and display the image frames in my GUI and
> > navigate frame by frame.
> 
> There are an indefinite number of incompatible .dat formats. Saying that 
> you imported the .dat file doesn't give me much confidence that you read 
> it in a way that Matlab would be able to understand the data.
> 
> We are going to need more information about how you wrote the .dat file 
> and how you are trying to read the file, and what results you are seeing.
0
Krishna
9/9/2010 7:29:23 AM
So why not just save a mat file, either one for the whole movie, or
one mat file for each frame if needed.  Let me get this straight.  Are
you extracting out and writing individual frames from your movie into
separate files?  And you have some measurements or parameters that are
unique for each frame and you're writing them back out?  And then
trying to read them back in again (from disk) in a different m-file?
0
ImageAnalyst
9/9/2010 10:19:23 AM
Are you suggesting to export as avi and bring it to matlab, and then save as .mat file for each frames or a whole movie. I think it's a painstaking effort. I already have custom code to read and extract this information but still I wish to read in the .dat format. I could send a sample file in both .dat and .avi format.  Perhaps you can help me out.









ImageAnalyst <imageanalyst@mailinator.com> wrote in message <dedba3e5-35da-42da-9469-2755b158078e@a11g2000vbn.googlegroups.com>...
> So why not just save a mat file, either one for the whole movie, or
> one mat file for each frame if needed.  Let me get this straight.  Are
> you extracting out and writing individual frames from your movie into
> separate files?  And you have some measurements or parameters that are
> unique for each frame and you're writing them back out?  And then
> trying to read them back in again (from disk) in a different m-file?
0
Sathish
9/9/2010 10:55:05 AM
It's not really clear (to me at least) what you have.  What I gathered
is that you already have an avi movie file, and that is what you're
starting with.  This is because you said "I have the detailed
information of the image frames (for ex,  frame rate, exposure time,
etc.) from the custom code" and you said that you already have a
"recorded movie."

Then I assume you read in frame by frame and (perhaps - it's not
clear) make some kind of measurements.  Then you say you "exported the
image frames as .dat (raw data) or .asc format."  So I take this to
mean that you took the existing movie, and perhaps any other
measurements you've created and then export them to one or more
(again, not clear) files with either .dat format or .asc format.

I was just suggesting that this set of output data (movie, individual
frames, or other measurements, again not clear) could be exported to a
standard data file format, like avi for a movie or .mat for other
data, instead of these non-specific and unsatisfactory .dat and/
or .asc files that you're having trouble with.  dat is not a standard
format anyway.  You could write out your own dat file with any kind of
crazy format you want but you can't be guaranteed the MATLAB will
understand it when it tries to read it back in.
0
imageanalyst (7623)
9/9/2010 1:31:15 PM
Recorded movie is not in avi format.  It is .sif file . only possibility is to export in some format where MATLAB recognize the file. I think exporting avi will lose all the header information, but it will be preserved in raw data file. 

Thanks
0
Sathish
9/9/2010 1:47:07 PM
On Sep 9, 9:47=A0am, "Sathish " <sathishkrishn...@gmail.com> wrote:
> Recorded movie is not in avi format. =A0It is .sif file . only possibilit=
y is to export in some format where MATLAB recognize the file. I think expo=
rting avi will lose all the header information, but it will be preserved in=
 raw data file.
>
> Thanks

--------------------------------------------------------------------
I don't know.  I'm not familiar with the details of either format.
What program would you be using to read in the sif file and write it
out to an avi file for MATLAB's consumption?
Image Analyst
0
imageanalyst (7623)
9/9/2010 9:14:38 PM
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <92c9cd2f-0fc4-4578-b350-9c282b787aa4@j2g2000vbo.googlegroups.com>...
> On Sep 9, 9:47 am, "Sathish " <sathishkrishn...@gmail.com> wrote:
> > Recorded movie is not in avi format.  It is .sif file . only possibility is to export in some format where MATLAB recognize the file. I think exporting avi will lose all the header information, but it will be preserved in raw data file.
> >
> > Thanks
> 
> --------------------------------------------------------------------
> I don't know.  I'm not familiar with the details of either format.
> What program would you be using to read in the sif file and write it
> out to an avi file for MATLAB's consumption?
> Image Analyst
-------------------------------------------------------------------------------------------------------

Exporting option comes with manufacturer software. 
0
9/11/2010 8:50:07 PM
On Sep 11, 4:50=A0pm, "Sathish " <sathishkrishn...@gmail.com> wrote:
> Exporting option comes with manufacturer software.
----------------------------------------------
Then ask that manufacturer for details on how the other information
like exposure, etc. can also be exported, in addition to the avi file.


0
ImageAnalyst
9/11/2010 10:13:56 PM
Reply: