[Gdcm-hackers] gdcm-git:Grassroots DICOM branch master updated. feab6aa2d61e53948954381d3510d0d751d
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mark R. <mm...@us...> - 2011-01-26 23:16:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, master has been updated
via feab6aa2d61e53948954381d3510d0d751d7d7c6 (commit)
from 248e80a110154cf28b6aa5e318c96346fb9e7a7e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://gdcm.git.sourceforge.net/git/gitweb.cgi?p=gdcm/gdcm;a=commit;h=feab6aa2d61e53948954381d3510d0d751d7d7c6
commit feab6aa2d61e53948954381d3510d0d751d7d7c6
Author: Mark Roden <mm...@gm...>
Date: Wed Jan 26 15:15:24 2011 -0800
added echo and find tests
diff --git a/Testing/Source/MessageExchangeDefinition/Cxx/CMakeLists.txt b/Testing/Source/MessageExchangeDefinition/Cxx/CMakeLists.txt
index 8cb27af..5be6cf4 100644
--- a/Testing/Source/MessageExchangeDefinition/Cxx/CMakeLists.txt
+++ b/Testing/Source/MessageExchangeDefinition/Cxx/CMakeLists.txt
@@ -5,6 +5,8 @@ TestULConnectionManager
TestAllFunctions
TestServiceClassUser
TestSCUValidation
+TestEcho
+TestFind
)
# Add the include paths
diff --git a/Testing/Source/MessageExchangeDefinition/Cxx/TestEcho.cxx b/Testing/Source/MessageExchangeDefinition/Cxx/TestEcho.cxx
new file mode 100644
index 0000000..74ea29c
--- /dev/null
+++ b/Testing/Source/MessageExchangeDefinition/Cxx/TestEcho.cxx
@@ -0,0 +1,34 @@
+/*=========================================================================
+ *
+ * Copyright Insight Software Consortium
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *=========================================================================*/
+
+#include "gdcmCompositeNetworkFunctions.h"
+
+
+int TestEcho(int argc, char *argv[])
+{
+ std::string hostname = "mi2b2.slicer.org";
+ int port = 11112;
+ std::string callaetitle = "MI2B2";
+ std::string callingaetitle = "ACME1";
+
+ gdcm::CompositeNetworkFunctions theNetworkFunctions;
+
+ bool didItWork = theNetworkFunctions.CEcho( hostname.c_str(), port, callingaetitle, callaetitle );
+
+ return (didItWork ? 0:1);
+}
\ No newline at end of file
diff --git a/Testing/Source/MessageExchangeDefinition/Cxx/TestFind.cxx b/Testing/Source/MessageExchangeDefinition/Cxx/TestFind.cxx
new file mode 100644
index 0000000..5aa98af
--- /dev/null
+++ b/Testing/Source/MessageExchangeDefinition/Cxx/TestFind.cxx
@@ -0,0 +1,61 @@
+/*=========================================================================
+ *
+ * Copyright Insight Software Consortium
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *=========================================================================*/
+
+#include "gdcmCompositeNetworkFunctions.h"
+#include "gdcmTag.h"
+#include "gdcmQueryFactory.h"
+
+
+int TestFind(int argc, char *argv[])
+{
+
+ std::string hostname = "mi2b2.slicer.org";
+ int port = 11112;
+ std::string callaetitle = "MI2B2";
+ std::string callingaetitle = "ACME1";
+
+ gdcm::CompositeNetworkFunctions theNetworkFunctions;
+
+ gdcm::Tag theTag(0x0010, 0x0010);
+ std::string theName = "F*";
+ std::pair<gdcm::Tag, std::string> theTagPair =
+ std::make_pair<gdcm::Tag, std::string>(theTag, theName);
+
+ std::vector<std::pair<gdcm::Tag, std::string> > theTags;
+ theTags.push_back(theTagPair);
+
+ gdcm::network::BaseRootQuery* theQuery = theNetworkFunctions.ConstructQuery(false, false, true, theTags);
+
+ if (!theQuery) {
+ std::cerr << "Query construction failed!" << std::endl;
+ return 1;
+ }
+
+ if (!theQuery->ValidateQuery(true, false))
+ {
+ std::cerr << "Find query is not valid. Please try again." << std::endl;
+ delete theQuery;
+ return 1;
+ }
+
+ std::vector<gdcm::DataSet> theDataSet = theNetworkFunctions.CFind(hostname.c_str(), port, callingaetitle, callaetitle, theQuery);
+
+ //need to put some kind of validation of theDataSet here
+
+ return (theDataSet.empty() ? 1:0);//shouldn't be a zero-sized dataset
+}
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
.../MessageExchangeDefinition/Cxx/CMakeLists.txt | 2 +
.../MessageExchangeDefinition/Cxx/TestEcho.cxx | 24 ++++----
.../MessageExchangeDefinition/Cxx/TestFind.cxx | 61 ++++++++++++++++++++
3 files changed, 75 insertions(+), 12 deletions(-)
copy Source/MessageExchangeDefinition/gdcmULBasicCallback.cxx => Testing/Source/MessageExchangeDefinition/Cxx/TestEcho.cxx (65%)
create mode 100644 Testing/Source/MessageExchangeDefinition/Cxx/TestFind.cxx
hooks/post-receive
--
Grassroots DICOM
|