ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Measurement question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jwest

Brazil
67 Posts

Posted - Jun 12 2011 :  10:16:30  Show Profile  Reply
Hi,

When working with TimageenVect and dicom image the measurement tools such as length, perimeter and others will take account about zoom, scale ... embedded into the dicom image or do I have to set it by hand.

In this case, how to read this tag values and set them.


Regards,

Luiz

fab

1310 Posts

Posted - Jun 12 2011 :  10:36:33  Show Profile  Reply
Hi,
you have to set manually DPI and scale, so ImageEn can calculate coefficients to convert pixels to selected measure unit.
You can set DPI with:

ImageEnVect.DpiX := ....
ImageEnVect.DpiY := ....
ImageEnVect.ScaleFactor := ....

Please look at the documentation and examples for more details.
Go to Top of Page

jwest

Brazil
67 Posts

Posted - Jun 19 2011 :  14:04:12  Show Profile  Reply
Hi,

I am trying to set DpiX and DpiY, but the measure still results wrong. My ImageEnVect has Munit setting as ieuCENTIMETERS.
Here is what I am doing:
begin
tags:=ImageEnMView1.MIO.Params[ImageEnMView1.SelectedImage].DICOM_Tags;
s := tags.GetTagString( tags.IndexOf($0028,$0030) );
i:=pos('\',s);
dx:=StrToFloatDef(copy(s,1,i-1),1); //transform string to float
dy:=StrToFloatDef(copy(s,i+1,20),1); //transform string to float
with ImageEnVect1 do begin
DpiX:=round(dx/2.54);
DpiY:=round(dy/2.54);
ScaleFactor:=1;
end;

Please, what can be wrong?

Regards,

Luiz
Go to Top of Page

fab

1310 Posts

Posted - Jun 19 2011 :  14:31:15  Show Profile  Reply
ScaleFactor must be set (calibrated) so that the measure becomes correct.
Often images have a line which indicates how much pixels corresponds to one centimeter (this is just an example).
For this reason exist the method SetScaleFromPixels and SetScaleFromSelectionLen. Look at "Measurement" section of the help file for more details and other related properties/methods.

Please look also the example at imageprocessing2\measureit.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: