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 : Saturday, January 20, 2007 11:32:58 AM(UTC)

pmh4514  
pmh4514

Groups: Registered
Posts: 5


I've been working with the Lead/Medicor Medical Imaging Suite SDK (v15) for a few weeks now under Visual C++ v6.0.

This must be straightforward, but I can't find any examples of doing it.
I need to load a bitmap file from disc into the PIXEL_DATA element.

The code I was trying is below, with questions contained within comments:


    LDicomDS*   pDS;
        pDS = new LDicomDS(szTempFilesFolder);
    pDS->InitDS(CLASS_VL_MICROSCOPIC_IMAGE_STORAGE, DS_METAHEADER_PRESENT |
                                                    DS_LITTLE_ENDIAN |
                                                    DS_EXPLICIT_VR |
                                                    DS_GROUP_LENGTHS);

    // I populate patient ID and all that other good stuff

    // now I need to load the BMP file into the dataset.
    // Don't know how.

    // This is what I started on reading about InsertImage() in the API

    pDICOMELEMENT pElement = NULL;
    L_INT32 lPhotoMetric    = IMAGE_PHOTOMETRIC_PALETTE_COLOR;
    L_INT32 lCompression    = IMAGE_COMPRESSION_JPEG_LOSSLESS;
    L_INT32 lBitDepth        = 8;
    L_INT32 lQuality        = 2;

    pBITMAPHANDLE pBitmap;

    // what here?? how do I load the BMP file from the know path into this BITMAPHANDLE?
   // you know, like I'd do this in MFC:
//     HBITMAP hBmp = (HBITMAP)::LoadImage(NULL, sPath,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION | 
    LR_LOADFROMFILE);       

    nRet = pDS->InsertImage(pElement, pBitmap, 0, lCompression, lPhotoMetric, lBitDepth, lQuality, DICOM_SETIMAGE_AUTO_SET_VOI_LUT, NULL, NULL);


    // now save it to a file.
    pDS->SaveDS(_T("c:\\test_dicom.dic"), 0);
    delete pDS;

EDIT: Additionally, why when I try to compile the above code I get unresolved external symbol errors during link? InsertImage() links fine, but SaveDS() does not:


DicomInterface.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned short __thiscall LDicomDS::SaveDS(unsigned short *,unsigned short)" (__imp_?SaveDS@LDicomDS@@QAEGPAGG@Z)
DicomInterface.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall LDicomDS::LDicomDS(unsigned short *)" (__imp_??0LDicomDS@@QAE@PAG@Z)



Thanks!
Paul

 

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, January 22, 2007 5:46:02 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

To load the image, create an instance of LBitmapBase, call the Load function to load the image, then call GetHandle to get the BITMAPHANDLE.

As for the link error, SaveDS requires Ltdic_u.lib in your project.  You need to include it if you are not doing so.

 
#3 Posted : Monday, January 22, 2007 6:42:41 AM(UTC)

pmh4514  
pmh4514

Groups: Registered
Posts: 5


Thanks Bashar.

edit: I had some more questions below about problems compiling, nevermind (if you happend to have already read them) I had failed to include LtWrappr.h

 
#4 Posted : Tuesday, January 23, 2007 12:33:19 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

No problem.  Were you successful in loading the image?

 
#5 Posted : Tuesday, January 23, 2007 3:33:48 AM(UTC)

pmh4514  
pmh4514

Groups: Registered
Posts: 5


Not yet - but that's because of the unresolved external symbol error I'm getting - I've posted another topic about that, here:

        http://support.leadtools...rums/10949/ShowPost.aspx

I'll update that thread in a bit. The demo at:

        C:\Program Files\LEAD Technologies\LEADTOOLS 15\Examples\API\Dicom

did compile successfully on my machine

I'm going to see if I can start a new project with the includes and see if I can duplicate it.
 
#6 Posted : Sunday, January 28, 2007 7:52:20 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

You should be able to solve the linking problem by linking to
LTWVC2_U.LIB instead of LTWVC_U.LIB.  Let me know if are still unable to solve this issue.

 
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.118 seconds.