Description

_ImageDescription, AddImageTag, Get_ImageInfo, LoadImageDescription, LoadImageFullDescription, SaveImageDescription, SaveImageFullDescription

AddImageTag

Description 

 AddImageTag(
   char *Filename,
   char *LimDescription,
   dword  BgColor,
   char *LimAuthor
);

Adds tags to the selected file.

Parameters

char *Filename

The path and the name of the file.

char *LimDescription

Description.

dword BgColor

Background color.

char *LimAuthor

Name of the author of the image. Maximum length is 63 characters. This description item is supported by LIM and JPEG2000 image format.

Get_ImageInfo

Description 

int Get_ImageInfo(
   char *Filename,
   int *LpWidth,
   int *LpHeight,
   int *LpBpc,
   int *LpPlaneCount
);

This function obtains width, height, bit depth and a number of channels of the specified image. The function is applied to the current image when the Filename parameter is left blank.

Parameters

char *Filename

The path and the name of the file.

int *LpWidth

Width of the image.

int *LpHeight

Returns the height of the image.

int *LpBpc

Returns bit depth value.

int *LpPlaneCount

Returns the number of channels in the image.

Return Values

int

This function returns the number of sequences in the image or -1 if function fails or the filename is not found.

LoadImageDescription

Description 

INT LoadImageDescription(
   char *Filename,
   char *Descr1,
   char *Descr2,
   char *Descr3,
   char *Descr4
);

This function fills buffers descr1, descr2, descr3, descr4 with image description saved along with the image data.

If filename == NULL (0), only memory archive items are overwritten, you can change them also by selecting Information menu from the application system menu.

Parameters

char *Filename

The path and the name of the file.

char *Descr1

Defines the Type field of the image info. The default value is Subject. Maximum length is 63 characters

char *Descr2

Defines the Sample ID field of image info. The default value is Sample. Maximum length is 63 characters.

char *Descr3

Defines the Author field of image info. The default value is Author. Maximum length is 63 characters.

char *Descr4

Defines the Description field of image info. The default value is Comment. Maximum length is 2047 characters.

Return Values

INT

This function returns TRUE (1), if the filename contains valid image. Otherwise it returns FALSE (0).

// LoadImageDescription example - lets you load and change the image descriptions.
word            day, month, year;
dword           dw;
char            caption[256],sdate[256];
char            cont[10000],file[256],file1[256];
char            d1[63],d2[63],d3[63],d4[2047];
char            d1_[63],d2_[63],d3_[63],d4_[2047];
int             qw;  
dw=Get_Date();
year = HIWORD(dw);
month=HIBYTE(LOWORD(dw));
day=LOBYTE(LOWORD(dw));
sprintf(sdate,"%i-%i-%i","day,month,year");
sprintf(caption,"API Example - LoadImageDescription.Date: %s","sdate");
Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
Wait(2);
sprintf(caption,"     Select the image.\tdate: %s     ","sdate");
Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
SelectFile(file,"Lim Images|*.lim|",0);
LoadImageDescription(file,d1_,d2_,d3_,d4_);
if(d1_[0] == 0) strcpy(d1," ");
else strcpy(d1,d1_);
if(d2_[0] == 0) strcpy(d2," ");
else strcpy(d2,d2_);
if(d3_[0] == 0) strcpy(d3," ");
else strcpy(d3,d3_);
if(d4_[0] == 0) strcpy(d4," ");
else strcpy(d4,d4_);
sprintf(cont,"File:\n%s\n\nInfo 1:\n%s\n\nInfo 2:\n%s\n\nInfo 3:\n%s\n\nInfo 4:\n%s\n","file,d1,d2,d3,d4");
Int_CreateWindow(1,"File description",6,0,0,400,460,cont,1,1,0.00000,1,1,1,"Arial,B,8");
qw = Int_Question("API Example","Modify file description?","&Yes","&No","","",1,0);
if(qw==BUTTON_1)
   {
   again1:
   strcpy(caption,"Select the action.");
   Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
   qw = Int_Question("API Example, ","What do you want to modify?","&Filename","&Descriptions","&Exit","",1,0);
   if(qw==BUTTON_1)
  {
  sprintf(caption,"Modify the filename.Old filename: %s","file");
  Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
  strcpy(file1,file);
  Int_GetString("API Example","Modify the filename:",file1,256);
  RenameFile(file1,file);
  strcpy(file,file1);      
  sprintf(cont,"File:\n%s\n\nInfo 1:\n%s\n\nInfo 2:\n%s\n\nInfo 3:\n%s\n\nInfo 4:\n%s\n","file,d1,d2,d3,d4");
  Int_SetWindowText(1,cont,0);
  goto again1;
  }
   if(qw==BUTTON_2)
  {
  strcpy(caption,"Select the description you want to modify.");
  Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
  qw = Int_Question("API Example","Select desription:","No.1","No.2","No.3","No.4",1,0);
  if(qw==BUTTON_1)
 {
 strcpy(caption,"Write new description No.1");
 Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
 Int_GetString("API Examle","Modify the description No.1",d1_,63);
 if(d1_[0] == 0) strcpy(d1,"");
 else strcpy(d1,d1_);
 SaveImageDescription(file,d1_,d2_,d3_,d4_);
 }
  if(qw==BUTTON_2)
 {
 strcpy(caption,"Write new description No.2");
 Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
 Int_GetString("API Example","Modify the description No.2",d2_,63);
 if(d2_[0] == 0) strcpy(d2,"");
 else strcpy(d2,d2_);
 SaveImageDescription(file,d1_,d2_,d3_,d4_);
 }
  if(qw==BUTTON_3)
 {
 strcpy(caption,"Write new description No.3");
 Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
 Int_GetString("API Example","Modify the description No.3",d3_,63);
 if(d3_[0] == 0) strcpy(d3,"");
 else strcpy(d3,d3_);
 SaveImageDescription(file,d1_,d2_,d3_,d4_);
 }
  if(qw==BUTTON_4)
 {
 strcpy(caption,"Write new description No.4");
 Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
 Int_GetString("API Example","Modify the description No.4",d4_,2047);
 if(d4_[0] == 0) strcpy(d4,"");
 else strcpy(d4,d4_);
 SaveImageDescription(file,d1_,d2_,d3_,d4_);
 }
  sprintf(cont,"File:\n%s\n\nInfo 1:\n%s\n\nInfo 2:\n%s\n\nInfo 3:\n%s\n\nInfo 4:\n%s","file,d1,d2,d3,d4");
  Int_SetWindowText(1,cont,0);
  goto again1;
  }
   if(qw==BUTTON_3) goto end;
   }
end:
Int_CloseTextWindow();
Int_SetWindowState(1,WS_DESTROY);

See Also 
Get_ImageCalibration

LoadImageFullDescription

Description 

int LoadImageFullDescription(
   char *Filename,
   char *LimOptics,
   char *LimType,
   char *LimSampleID,
   char *LimAuthor,
   char *LimDescription,
   char *ImageID,
   char *Group,
   char *Capturing,
   char *Sampling,
   char *Location,
   char *Jp2Date,
   char *Conclusion,
   char *Info1,
   char *Info2
);

This function retrieves the full image description saved along with the image data.

If the filename is NULL (0), the current image description is loaded.

Parameters

char *Filename

The path and the name of the file.

char *LimOptics

Description of the optics used during acquisition. Filled on output. This description item is supported by the LIM, JPEG2000, TIFF and ND2 image formats.

char *LimType

Description of a type of the image. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by LIM and JPEG2000 image format.

char *LimSampleID

Sample identification. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. (This description item is supported by LIM and JPEG2000 image format.)

char *LimAuthor

Name of the author of the image. Maximum length is 63 characters. This description item is supported by LIM and JPEG2000 image format.

char *LimDescription

Description.

char *ImageID

Image identification. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output.

char *Group

Image group description. Maximum length is 63 characters. This description item is supported by JPEG2000 image format.

char *Capturing

Image capturing description. May contain e.g. capturing conditions etc. Maximum length is 2047 characters. This description item is supported by JPEG2000, TIF, and ND2 image formats.

char *Sampling

Description of Sampling saved within the image metadata. This description item is supported by JPEG2000, TIFF, and ND2 image formats.

char *Location

Description of a location - part of the image information metadata. Maximum length is 63 characters. This description item is supported by JPEG2000, TIFF and ND2 image formats.

char *Jp2Date

Date of the image creation. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by JPEG2000 image format.

char *Conclusion

Conclusion description. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output.

char *Info1

Additional image information. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by JPEG2000 image format.

char *Info2

Additional image information. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by JPEG2000 image format.

Return Values

int

This function returns TRUE (1), if the filename contains valid image. Otherwise it returns FALSE (0).

See Also 
LoadImageDescription

SaveImageDescription

Description 

int SaveImageDescription(
   char *Filename,
   char *Descr1,
   char *Descr2,
   char *Descr3,
   char *Descr4
);

This function changes the image description of the specified image.

If the Filename is NULL (0), only memory archive items are overwritten. You can change them also by selecting the Information menu from the application system menu.

Parameters

char *Filename

The path and the name of the file.

char *Descr1

Defines the Type field of the image info. The default value is Subject. Maximum length is 63 characters

char *Descr2

Defines the Sample ID field of image info. The default value is Sample. Maximum length is 63 characters.

char *Descr3

Defines the Author field of image info. The default value is Author. Maximum length is 63 characters.

char *Descr4

Defines the Description field of image info. The default value is Comment. Maximum length is 2047 characters.

Return Values

int

This function returns TRUE (1), if the filename contains valid image. Otherwise it returns FALSE (0).

See Also 
LoadImageDescription, Get_ImageCalibration, SaveImageCalibration, Get_Calibration

SaveImageFullDescription

Description 

 SaveImageFullDescription(
   char *Filename,
   char *LimOptics,
   char *LimType,
   char *LimSampleID,
   char *LimAuthor,
   char *LimDescription,
   char *ImageID,
   char *Group,
   char *Capturing,
   char *Sampling,
   char *Location,
   char *Jp2Date,
   char *Conclusion,
   char *Info1,
   char *Info2
);

This function changes the whole image description of the specified image.

Parameters

char *Filename

The path and the name of the file.

char *LimOptics

Description of the optics used during acquisition. Filled on output. This description item is supported by the LIM, JPEG2000, TIFF and ND2 image formats.

char *LimType

Description of a type of the image. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by LIM and JPEG2000 image format.

char *LimSampleID

Sample identification. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. (This description item is supported by LIM and JPEG2000 image format.)

char *LimAuthor

Name of the author of the image. Maximum length is 63 characters. This description item is supported by LIM and JPEG2000 image format.

char *LimDescription

Description.

char *ImageID

Image identification. This description item is supported by JPEG2000 image format.

char *Group

Image group description. Maximum length is 63 characters. This description item is supported by JPEG2000 image format.

char *Capturing

Image capturing description. May contain e.g. capturing conditions etc. Maximum length is 2047 characters. This description item is supported by JPEG2000, TIF, and ND2 image formats.

char *Sampling

Description of Sampling saved within the image metadata. This description item is supported by JPEG2000, TIFF, and ND2 image formats.

char *Location

Description of a location - part of the image information metadata. Maximum length is 63 characters. This description item is supported by JPEG2000, TIFF and ND2 image formats.

char *Jp2Date

Date of the image creation. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by JPEG2000 image format.

char *Conclusion

Conclusion description. This description item is supported by JPEG2000 image format.

char *Info1

Additional image information. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by JPEG2000 image format.

char *Info2

Additional image information. Maximum length is 63 characters. Macro is responsible for the buffer allocation. Filled on output. This description item is supported by JPEG2000 image format.

Return Values

This function returns TRUE (1), if the filename contains valid image. Otherwise it returns FALSE (0).

See Also 
SaveImageDescription, SaveImageCalibration, Get_Calibration

_ImageDescription

This function runs the File > Image Properties command.

Description 

 _ImageDescription();

This function displays the Image Properties dialog window with information about the current image.