[Insight-users] part of dcmtk not found (but needed) when building the insightapplications

Eduardo Suarez eduardo at ctm.ulpgc.es
Mon Jun 19 08:54:46 EDT 2006


This worked for me.
-Eduardo

*****************************************************************************
/usr/local/dcmtk-3.5.3/dcmtk-3.5.3-v02/dcmsign/libsrc:

//@BEGIN eduardo
//@vie mar 17 17:24:07 WET 2006
//@extraido de http://forum.dcmtk.org/viewtopic.php?t=512&highlight=sicert
                x509 = d2i_X509(NULL, (const unsigned char **) &data,
cert->getLength());
//-              x509 = d2i_X509(NULL, &data, cert->getLength());
//@END eduardo



*****************************************************************************
/usr/local/dcmtk-3.5.3/dcmtk-3.5.3-v02/ofstd/libsrc/ofthread.cc:

//@BEGIN eduardo
//@vie mar 17 16:35:36 WET 2006 - v01
//@para que compile con gcc-4.0
//@a partir de
http://forum.dcmtk.org/viewtopic.php?t=354&start=0&postdays=0&postorder=asc&highlight=&sid=512c284c3ffa02dea3c84cb525604aef
#ifdef HAVE_POINTER_TYPE_PTHREAD_T
    if (0 == result) theThread = tid; else theThread = 0;
#else
    if (0 == result) theThread = OFstatic_cast(unsigned long, tid); else
theThread = 0;
#endif
    return result;
#elif defined(SOLARIS_INTERFACE)
    thread_t tid=0;
    int result = thr_create(NULL, 0, thread_stub, OFstatic_cast(void *,
this), 0,
&tid);
    if (0 == result) theThread = OFstatic_cast(unsigned long, tid); else
theThread = 0;
    return result;
#else
    return -1;
#endif
}
//-  if (0 == result) theThread = OFreinterpret_cast(unsigned long,
tid); else theThread = 0;
//-  return result;
//-#elif defined(SOLARIS_INTERFACE)
//-  thread_t tid=0;
//-  int result = thr_create(NULL, 0, thread_stub, OFstatic_cast(void *,
this),
0, &tid);
//-  if (0 == result) theThread = OFstatic_cast(unsigned long, tid);
else theThread = 0;
//-  return result;
//-#else
//-  return -1;
//-#endif
//-}
//@END eduardo

int OFThread::join()
{
#ifdef WINDOWS_INTERFACE
    if (WaitForSingleObject((HANDLE)theThreadHandle, INFINITE) ==
WAIT_OBJECT_0) return 0;
    else return (int)GetLastError();
#elif defined(POSIX_INTERFACE)
    void *retcode=NULL;
//@BEGIN eduardo
//@vie mar 17 16:49:47 WET 2006 - v01
//@modificado
    return pthread_join(OFstatic_cast(pthread_t, theThread), &retcode);
//-  return pthread_join(OFreinterpret_cast(pthread_t, theThread),
&retcode);
//@END eduardo
#elif defined(SOLARIS_INTERFACE)
    void *retcode=NULL;
    // reinterpret_cast does not work for gcc 3.x
    return thr_join(OFstatic_cast(thread_t, theThread), NULL, &retcode);
#else
    return -1;
#endif
}

unsigned long OFThread::threadID()
{
//@BEGIN eduardo
//@vie mar 17 16:49:47 WET 2006 - v01
//@modificado
#ifdef HAVE_POINTER_TYPE_PTHREAD_T
    // dangerous - we cast a pointer type to unsigned long and hope that it
    // remains valid after casting back to a pointer type.
    return OFreinterpret_cast(unsigned long, theThread);
#else
    return theThread;
#endif
//-  return theThread;
//@END eduardo
}

#if defined(WINDOWS_INTERFACE) || defined(POSIX_INTERFACE) ||
defined(SOLARIS_INTERFACE)
OFBool OFThread::equal(unsigned long tID)
#else
OFBool OFThread::equal(unsigned long /* tID */ )
#endif
{
#ifdef WINDOWS_INTERFACE
    if (theThread == tID) return OFTrue; else return OFFalse;
#elif defined(POSIX_INTERFACE)
//@BEGIN eduardo
//@vie mar 17 16:49:47 WET 2006 - v01
//@modificado
#ifdef HAVE_POINTER_TYPE_PTHREAD_T
    // dangerous - we cast an unsigned long back to a pointer type and
hope that it is still valid
    if (pthread_equal(OFstatic_cast(pthread_t, theThread),
OFreinterpret_cast(pthread_t, tID))) return OFTrue; else return OFFalse;
#else
    if (pthread_equal(OFstatic_cast(pthread_t, theThread),
OFstatic_cast(pthread_t, tID))) return OFTrue; else return OFFalse;
#endif
//-  if (pthread_equal(OFreinterpret_cast(pthread_t, theThread),
OFreinterpret_cast(pthread_t, tID))) return OFTrue; else return OFFalse;
//@END eduardo
#elif defined(SOLARIS_INTERFACE)
    if (OFstatic_cast(thread_t, theThread) == OFstatic_cast(thread_t,
tID)) return OFTrue; else return OFFalse;
#else
    return 0;
#endif
}

void OFThread::thread_exit()
{
#ifdef WINDOWS_INTERFACE
    _endthreadex(0);
#elif defined(POSIX_INTERFACE)
    pthread_exit(NULL);
#elif defined(SOLARIS_INTERFACE)
    thr_exit(NULL);
#else
#endif
    return; // will never be reached
}

unsigned long OFThread::self()
{
#ifdef WINDOWS_INTERFACE
    return OFstatic_cast(unsigned long, GetCurrentThreadId());
#elif defined(POSIX_INTERFACE)
//@BEGIN eduardo
//@vie mar 17 16:49:47 WET 2006 - v01
//@modificado
#ifdef HAVE_POINTER_TYPE_PTHREAD_T
    return OFreinterpret_cast(unsigned long, pthread_self());
#else
    return OFstatic_cast(unsigned long, pthread_self());
#endif
//-  return OFreinterpret_cast(unsigned long, pthread_self());
//@END eduardo

*****************************************************************************


kavec at messi.uku.fi wrote:
> Hi,
> 
> I tried to get running this application about a month ago and had the same
> problem. I found that this ITK application is designed for older dcmtk version,
> can not remember which one exactly. The lates dcmtk does not use imagedb
> anymore.
> 
> Regards,
> 
> Martin
> 
> Quoting kdsfinger at gmail.com:
> 
>> hi, all
>> I am trying to build the InsightApplications-2.4.0 with cmake
>> 2.2-patch3 and DCMTK-3.5.4 but got the following info when doing
>> ccmake:
>>
>> DCMTK_imagedb_INCLUDE_DIR-NOTFOUND
>> DCMTK_imagedb_LIBRARY-NOTFOUND
>>
>> I googled on the internet and found that the 2 files contains in
>> earlier dcmtk, not the newest version 3.5.4. Since I do need the dcmtk
>> in itk, should I go back for an earlier version of dcmtk or is there
>> some cmake files work for the 3.5.4? or does the cmake-2.4.2 fix the
>> problem? Thanks for your reply.
>>
>> zl2k
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3369 bytes
Desc: S/MIME Cryptographic Signature
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060619/04e060a5/smime-0001.bin


More information about the Insight-users mailing list