COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### adding frames dicom images

• Email
• Follow

```hai all
I am trying to add a series of the dicom images.  But the images are in uint16 If i add it exceeds the maximum value .I tried even converting the values in the double but again it reaches the value of 1  so i cant visualize the images after adding images

can any one please help me to solve the problem
```
 0
Reply prabakar 1/3/2011 4:35:26 PM

See related articles to this posting

```2011.01.03 18:35, prabakar rašė:
> hai all
> I am trying to add a series of the dicom images. But the images are in
> uint16 If i add it exceeds the maximum value .
....
> can any one please help me to solve the problem

imshow(img,*[]*)

```
 0
Reply ejs 1/4/2011 12:07:40 AM

```2011.01.03 18:35, prabakar rašė:
> hai all
> I am trying to add a series of the dicom images. But the images are in
> uint16 If i add it exceeds the maximum value .
....
> can any one please help me to solve the problem

imshow(img,[])

```
 0
Reply ejs 1/4/2011 12:09:03 AM

```On Jan 3, 11:35=A0am, "prabakar " <prabakar992...@yahoo.co.in> wrote:
> hai all
> I am trying to add a series of the dicom images. =A0But the images are in=
uint16 If i add it exceeds the maximum value .I tried even converting the =
values in the double but again it reaches the value of 1 =A0so i cant visua=
lize the images after adding images
>
> can any one please help me to solve the problem

---------------------------------------------
Show your code.  If you convert each and every uint16 image array to
double BEFORE you add them together, you will not have clipping at 1
or at any value (other than realmax =3D 1.7977e+308).  You're doing
something wrong because your uint16 values are *already* greater than
1 to begin with.

u1 =3D uint16(60000)
u2 =3D uint16(55000)
doubleValue =3D double(u1) + double(u2)

u1 =3D
60000
u2 =3D
55000
doubleValue =3D
115000

Note: doublevalue is greater than 65535 which is intmax('uint16').  It
did not clip anything to 1.
```
 0
Reply ImageAnalyst 1/4/2011 2:29:43 AM

```ImageAnalyst <imageanalyst@mailinator.com> wrote in message <23111c36-ba86-41ad-ac46-2a5e3753bb10@l8g2000yqh.googlegroups.com>...
> On Jan 3, 11:35 am, "prabakar " <prabakar992...@yahoo.co.in> wrote:
> > hai all
> > I am trying to add a series of the dicom images.  But the images are in uint16 If i add it exceeds the maximum value .I tried even converting the values in the double but again it reaches the value of 1  so i cant visualize the images after adding images
> >
> > can any one please help me to solve the problem
>
> ---------------------------------------------
> Show your code.  If you convert each and every uint16 image array to
> double BEFORE you add them together, you will not have clipping at 1
> or at any value (other than realmax = 1.7977e+308).  You're doing
> something wrong because your uint16 values are *already* greater than
> 1 to begin with.
>
> u1 = uint16(60000)
> u2 = uint16(55000)
> doubleValue = double(u1) + double(u2)
>
> u1 =
>   60000
> u2 =
>   55000
> doubleValue =
>       115000
>
> Note: doublevalue is greater than 65535 which is intmax('uint16').  It
> did not clip anything to 1.

For a matrix that may be possible but while displaying the image  the maximum value for double is one.
final = uint16(zeros(768,1024,1,17));
for img = 1:17
end
image= im2double(final);
x = double(zeros(768,1024,1));
for i = 1:17
end
imwrite(x,'my_data.tif','tif')
This is code to add 17 images in a folder which are in uint16  i converted it in double and then added .
```
 0
Reply prabakar 1/4/2011 1:11:05 PM

```im2double scales to [0,1]].  Don't use that if you don't want that
scaling.  Use double() like I showed you.

Also don't use "image" as the name of your variable because that is a
built-in function name that you will be redefining and you will then
no longer be able to use that function.  Similar for i as your loop
counter (i is the imaginary constant) - use k instead.
```
 0
Reply ImageAnalyst 1/4/2011 4:39:38 PM

5 Replies
475 Views

Similar Articles

12/7/2013 2:51:53 PM
page loaded in 40250 ms. (0)