ImFusion SDK 4.3
DicomWorklist.cpp
#include <ImFusion/Core/Log.h>
#include <ImFusion/Dicom/DicomModalityWorklist.h>
#include <dcmtk/dcmdata/dctk.h>
int main()
{
// A simple example that reads the DICOM Modality Worklist of DCMTKs wlmscpfs SCP.
// To get the server running:
// 1. Clone the dcmtk repository and go to the dcmwlm/data/wlistdb folder
// 2. Convert the files in the OFFIS directory with: dump2dcm -g wklist1.dump wklist1.wl
// 3. Start the server on port 8080: wlmscpfs 8080
ImFusion::DicomPacsConfiguration config("localhost", 8080, "OFFIS");
config.clientPort = 11112;
config.clientAETitle = "OFFIS";
config.cfgFilePath = "";
config.connectionTimeout = 3;
// filter by station AE title
DcmItem* scheduledProcedure = nullptr;
request->findAndGetSequenceItem(DCM_ScheduledProcedureStepSequence, scheduledProcedure);
scheduledProcedure->putAndInsertString(DCM_ScheduledStationAETitle, "AB45");
// Will return 2 items
auto results = ImFusion::Dicom::ModalityWorklist::getWorklist(config, *request);
for (const auto& result : results)
{
result->print(ss);
LOG_INFO(ss.str());
}
}
std::unique_ptr< DcmDataset > createMinimalRequest()
Creates a minimal request object.
std::vector< std::unique_ptr< DcmDataset > > getWorklist(DicomPacsConfiguration config, DcmDataset &request, std::atomic< bool > *abortFlag=nullptr)
Retrieves a Modality Worklist from the given server.
#define LOG_INFO(...)
Emits a log message of Log::Level::Info, optionally with a category.
Definition Log.h:247
T str(T... args)
Structure encapsulating all information needed to connect to a PACS instance.
Definition DicomPacsCommunication.h:27
std::string clientAETitle
Application Entity to use by the DICOM SCP server for receiving images.
Definition DicomPacsCommunication.h:57
std::string cfgFilePath
Path to a association config file to be used by the DICOM SCP server. May be empty for default config...
Definition DicomPacsCommunication.h:59
int connectionTimeout
Connection Timeout (seconds)
Definition DicomPacsCommunication.h:60
unsigned int clientPort
Port to use by the DICOM SCP server for receiving images.
Definition DicomPacsCommunication.h:56
Search Tab / S to search, Esc to close