DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2017-10-23, 07:05

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Fri, 2017-09-22, 14:06 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Hello everyone,

first I need to say, that I'm quite new to programming with C++ in Visual Studio and I'm not very good at using VS2017 yet.
My only experience with VS was once in a lecture for C# on VS2015.

But now I want to tell you about my problem...

I want to install DCMTK 3.6.2 for Visual Studio that I can handle DICOM files for my master thesis.

So I downloaded it and tried to follow the instructions in the INSTALL file. On my machine I run the following:
- Windows 10 Enterprise 2016 LTSB - 64-bit
- Visual Studio Community 2017 version 15.3.5
- CMake 3.8.2 - as in the INSTALL file recommended
(Are this information too specific?)

As I am not a computer scientist I failed once or twice, but finally I got everything right with CMake and created a folder, where the ALL_BUILD and INSTALL projects for VS are stored. Then I ran the ALL_BUILD in VS. That worked well, but at the end of it there was an error, that there was no project for the builds.
Then I tried to run the INSTALL project, but in VS only the ALL_BUILD project was opened and running it again brought me to the same result.

So now I'm wondering how I can complete the installation of the DCMTK libraries.

I hope you can help me. For better understanding I also took some screenshots and hope it can help.

https://picload.org/view/dgaoagol/vs_taskbar.jpg.html
This is how my taskbar in VS looks like. With this I ran the file

https://picload.org/view/dgaoagow/vs_error.jpg.html
This is the error at the end of running the ALL_BUILD

https://picload.org/view/dgaoagoi/vs_1strun.jpg.html
This is the end of the VS Output Window after running the ALL_BUILD the first time

https://picload.org/view/dgaoaglr/vs_2ndrun.jpg.html
This is the end of the VS Output Window after running the ALL_BUILD a second time

I'm looking forward to an answer and want to say thank you just right now! Have a nice weekend!

Best greetings,
Chris


Top
 Profile  
 
PostPosted: Fri, 2017-09-22, 16:07 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1622
Location: Oldenburg, Germany
Hi Chris,

there is something fishy with your setup. Maybe you can check whether you roughly followed this guide? Note that it is a bit outdated (so newer CMake options are not explained or the version number is not correct), but the general approach is completely the same.

Best,
Michael


Top
 Profile  
 
PostPosted: Mon, 2017-09-25, 07:16 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Michael Onken wrote:
Maybe you can check whether you roughly followed this guide?


Hello Michael,

thanks for your answer. I tried to open the guide you linked for me. But I cannot open it. There is an proxy error
Quote:
Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /redmine/projects/dcmtk/wiki/Howto_CMakeConfiguration.

Reason: Error reading from remote server


Can I find this guide anywhere else?

Thanks for answers. Greetings, Chris


Top
 Profile  
 
PostPosted: Mon, 2017-09-25, 10:32 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Mon, 2014-03-03, 09:51
Posts: 216
Location: Oldenburg, Germany
Hi Chris,

we had a problem with the server the wiki is running on. It is currently rebooting and should be back in a few minutes (hopefully).

Best
Jan


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 07:41 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Good morning guys,
I hope you are all fine =)

because I had some other issues and a free day, I just came to check your way this morning.

Well, I checked and followed your page for the CMake Configuration and did as the guide told me.
Then I ran Visual Studio, opened the project and tried to build the ALL_BUILD, as in this picture.

It ran for a while and finally got me this message. So far so good. So then I tried to handle the same way with the INSTALL project and got an error that I had to do this as an administrator.
So I did and got this result.

I'm still not sure this had to be the result allthough I think on the other handside it looks quite good.
But when I checked the succes of the installation with an example I found online, it didn't work because the libraries cannot be opened, see this.

I hope you can help me again. Thank you and have a good day!

Greetings, Chris


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 10:12 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1622
Location: Oldenburg, Germany
Hi,

good news, the build and installation went fine now :)

In order to ensure that Visual Studio finds the DCMTK header files, you have to add the include path of your DCMTK installation, i.e. the path
c:\Program Files (X86)\DCMTK\include (hope I copied it correctly from your screenshot). Google if you do not know, how to add an include path, e.g. this answer could help (did not check thoroughly).

Best,
Michael


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 11:25 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Hi Michael,

thanks for the information. I'm very glad to see this.

So I tried to handle path changing in Visual Studio and got beaten, but I found out that it works with including the whole path.

Thanks a lot for your help!!!

Best,
Chris


Top
 Profile  
 
PostPosted: Fri, 2017-09-29, 08:03 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1622
Location: Oldenburg, Germany
Sure, you're welcome :)


Top
 Profile  
 
PostPosted: Wed, 2017-10-04, 08:57 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Good morning everybody,

after a review of the answer, the link and what I've done I finally can tell you that I got the problem fixed.

So again I want to thank you for your great help.

EDIT:
After some tries writing code I finally found out VS tries to tell me that the whole libraries are full of errors???
I dunno how this can be, but most of the over 700 errors while trying to get sequence items with your example code from here are called "variable ... is not a type name".
Did there still something go wrong? Or is something with my VS setting creepy?
EDIT End

And I have another question allthough I know it doesn't belong to this forum area, but maybe you can tell me anyway.
In the DCMTK Wiki the DCMTK Primer doesn't work. Where can I find it?

Thanks again and have a nice day!

Best, Chris


Top
 Profile  
 
PostPosted: Wed, 2017-10-04, 11:44 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1622
Location: Oldenburg, Germany
Hi,

the primer just has not been written yet ;)

What is the exact error in the other example you tried to compile? It compiles for me on my linux system; it should also work on Windows. Probably you should paste the compiler log (or upload it somewhere and paste a link).

Best,
Michael


Top
 Profile  
 
PostPosted: Wed, 2017-10-04, 12:13 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Hi Michael,

thanks for your fast answer. Well, this is the code:
Code:
#include <dcmtk/config/osconfig.h>
#include <dcmtk/dcmdata/dctk.h>

int main(int argc, char *argv[])
{
   DcmFileFormat fileformat;
   if (fileformat.loadFile("C:\00_Mein Ordner\00_Studium\Master\Plan_Test.dcm").good())
   {
      DcmItem *item = NULL;
      DcmDataset *dataset = fileformat.getDataset();
      if (dataset->findAndGetSequenceItem(DCM_ProcedureCodeSequence, item, 0 /* first item */).good())
      {
         OFString codeMeaning;
         if (item->findAndGetOFString(DCM_CodeMeaning, codeMeaning).good())
         {
            COUT << codeMeaning; /* output value of "codeMeaning" or do something else with this information */
         }
      }
   }
   return 0;
}

It was copied as in the mentioned example, but I changed the output command.
After restarting VS it didn't recognize any errors as before. But running the code didn't work and I got an error list with 13 points, you can check out here.

All those errors doesn't tell me anything, but I may be not smart enough for that :|

But I hope you are able to tell me what to do =)

Thanks a lot.
Best, Chris


Top
 Profile  
 
PostPosted: Wed, 2017-10-04, 12:50 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1622
Location: Oldenburg, Germany
Hi,

read about compiling c and c++ code in general. You need to tell Visual Studio which libraries it should link to your executable.

Every c/c++ file is compiled as such, and in the end they are linked together into an executable. If you link "dynamically" (as you seem to do) then the compiler looks for the libraries during runtime (i.e. for the DCMTK DLLs that you probably have on your hard disk the moment you installed DCMTK).

As a simple solution you could try to copy all DCMTK-related DLLs (just search your DCMTK install folder) to the folder where the binary exists.

I think we are leaving the area of DCMTK-related questions and you definitely should work through some C++ tutorials!

Best,
Michael


Top
 Profile  
 
PostPosted: Wed, 2017-10-04, 13:37 
Offline

Joined: Fri, 2017-09-22, 13:38
Posts: 7
Hey,

thanks for your answer and your advice.
I'll go and check it out :)

Best,
Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group