Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, February 25, 2008 10:47:45 AM(UTC)
GDuntley

Groups: Registered
Posts: 2


Sorry the preview thing mislead me.

I am using the CSDicomServerDemo to receive Incoming DICOM Images and CSDicomStoreDemo to send them. What I want to is to insert the received DICOM images in their original format to an MS SQL 2005 database but when I try to do so in the MR.dcm file that contains 16 frames only one gets stored.

Second, if I were to store a jpeg compressed image can I store all the frames?

--------------- CODE --------------------------------
RasterImage image;
//I am receiving MR.dcm and here the 16 Frames can be seen
image = ds.GetImages(pixelDataElement, 0, ds.GetImageCount(pixelDataElement),
0,
RasterByteOrder.Rgb, DicomGetImageFlags.AllowRangeExpansion
| DicomGetImageFlags.AutoApplyModalityLut
| DicomGetImageFlags.AutoApplyVoiLut);
if (image == null)
{
System.Windows.Forms.MessageBox.Show("Can't retrieve image", "Sample");
return;
}

RasterCodecs _codecs;

System.IO.MemoryStream iostrm;

long strsize = 0;

try
{
iostrm = new System.IO.MemoryStream();
strsize = 0;
_codecs = new RasterCodecs();
strsize = _codecs.Save(image, iostrm, 0, RasterImageFormat.Cmp,0);
_codecs.Dispose();

SQLCmd.CommandText = SqlStr
SQLCmd.CommandType = CmdType

SqlParameter sqlParam = New
System.Data.SqlClient.SqlParameter(
myParam.Key.ToString,
SqlDbType.VarBinary,
strsize)
sqlParam.Value = iostrm.GetBuffer();
SQLCmd.Parameters.Add(sqlParam);

SQLCmd.ExecuteNonQuery();


iostrm.Close();
} //try
catch (Exception ex)
{
} //catch (Exception ex)

RasterCodecs.Shutdown();

--------------- CODE --------------------------------

When I get the value from the database using the medical viewer I only get one frame from the 15.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, February 25, 2008 11:53:55 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


You are saving the image as CMP, which does not support multiple pages. You should save as something like TIF if you want to have multiple pages in a single file.

If you want to use CMP, you'll need to save each page as a separate file (or Stream) by using one of the overloads that specifies which page you are using:


Code:
public void Save( 
RasterImage image,
Stream stream,
RasterImageFormat format,
int bitsPerPixel,
int firstPage,
int lastPage,
int firstSavePageNumber,
CodecsSavePageMode pageMode
)

Edited by moderator Thursday, August 8, 2019 1:32:44 PM(UTC)  | Reason: Not specified

 
#3 Posted : Tuesday, February 26, 2008 3:26:45 AM(UTC)
GDuntley

Groups: Registered
Posts: 2


Thank you
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.095 seconds.