# HG changeset patch # User John D # Date 1487876921 18000 # Node ID 2dbbba3cfa868a05f8179b777c1d2197cc85b297 # Parent 7f5714e377254da146227c113d003a17fd6bfa24 of-dicom: update to 0.2.0 * src/of-dicom.mk: update version, checksum, if non navtive, set CMAKE_BINARY and pass to build * of-dicom-1-fixes.patch: removed * of-dicom-2-gdcm2.4.patch: removed * dist-files.mk: removed unused patches diff -r 7f5714e37725 -r 2dbbba3cfa86 dist-files.mk --- a/dist-files.mk Thu Feb 23 14:08:40 2017 -0500 +++ b/dist-files.mk Thu Feb 23 14:08:41 2017 -0500 @@ -447,8 +447,6 @@ of-database.mk \ of-dataframe-1-fixes.patch \ of-dataframe.mk \ - of-dicom-1-fixes.patch \ - of-dicom-2-gdcm2.4.patch \ of-dicom.mk \ of-financial.mk \ of-fits-1-cross-fixes.patch \ diff -r 7f5714e37725 -r 2dbbba3cfa86 src/of-dicom-1-fixes.patch --- a/src/of-dicom-1-fixes.patch Thu Feb 23 14:08:40 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -diff -ur dicom.orig/src/dicominfo.cpp dicom/src/dicominfo.cpp ---- dicom.orig/src/dicominfo.cpp 2015-04-15 21:36:10.000000000 -0400 -+++ dicom/src/dicominfo.cpp 2015-04-15 21:41:21.000000000 -0400 -@@ -76,10 +76,10 @@ - char* byteval2string(char * d, int d_len_p, const gdcm::ByteValue *bv); - char* name2Keyword(char *d, int *d_len_p, const char* s); - Matrix str2DoubleVec(const char*); --Octave_map dump(const char filename[], int chatty); --void dumpDataSet(Octave_map *om, const gdcm::DataSet *ds, int chatty, int sequenceDepth); -+octave_map dump(const char filename[], int chatty); -+void dumpDataSet(octave_map *om, const gdcm::DataSet *ds, int chatty, int sequenceDepth); - void getFileModTime(char *timeStr, const char *filename); --void dumpElement(Octave_map *om, const gdcm::DataElement * elem, int chatty, int sequenceDepth); -+void dumpElement(octave_map *om, const gdcm::DataElement * elem, int chatty, int sequenceDepth); - void dumpSequence(octave_value *ov, gdcm::SequenceOfItems *seq, int chatty, int sequenceDepth); - int element2value(std::string & varname, octave_value *ov, const gdcm::DataElement * elem, int chatty, int sequenceDepth) ; - -@@ -163,7 +163,7 @@ - } - } - -- Octave_map om=dump(filename.c_str(),chatty); -+ octave_map om=dump(filename.c_str(),chatty); - retval(0)=om; - - load_dicom_dict(current_dict.c_str()); // reset dictionary to initial value -@@ -172,9 +172,9 @@ - #endif - - --Octave_map dump(const char filename[], int chatty) { -+octave_map dump(const char filename[], int chatty) { - // output struct -- Octave_map om; -+ octave_map om; - // Instantiate the reader: - gdcm::Reader reader; - reader.SetFileName( filename ); -@@ -202,7 +202,7 @@ - return om; - } - --void dumpDataSet(Octave_map *om, const gdcm::DataSet *ds, int chatty, int sequenceDepth) { -+void dumpDataSet(octave_map *om, const gdcm::DataSet *ds, int chatty, int sequenceDepth) { - - const gdcm::DataSet::DataElementSet DES=ds->GetDES(); // gdcm::DataSet::DataElementSet is a std::set - gdcm::DataSet::Iterator it; -@@ -212,7 +212,7 @@ - } - } - --void dumpElement(Octave_map *om, const gdcm::DataElement * elem, -+void dumpElement(octave_map *om, const gdcm::DataElement * elem, - int chatty, int sequenceDepth) { - std::string varname; - octave_value ov; -@@ -453,10 +453,10 @@ - const octave_idx_type nDataSet=seq->GetNumberOfItems(); // objects in sequence - if (chatty) octave_stdout << nDataSet << " object" << ((nDataSet==1)?"":"s") << std::endl; - char item_name_buf[16]; -- Octave_map om; -+ octave_map om; - for (octave_idx_type j=1; j<=nDataSet; j++ ) { - const gdcm::DataSet::DataElementSet des=seq->GetItem(j).GetNestedDataSet().GetDES() ; -- Octave_map subom; -+ octave_map subom; - for (gdcm::DataSet::Iterator it=des.begin(); it != des.end(); it++) { - std::string key(""); - octave_value subov; -diff -ur dicom.orig/src/dicomwrite.cpp dicom/src/dicomwrite.cpp ---- dicom.orig/src/dicomwrite.cpp 2015-04-15 21:36:10.000000000 -0400 -+++ dicom/src/dicomwrite.cpp 2015-04-15 21:41:49.000000000 -0400 -@@ -43,7 +43,7 @@ - // TODO all fns here should throw exceptions, not use this "std::string & err" arg - - void struct2metadata(gdcm::ImageWriter *w, gdcm::File *file, const octave_value & ov, bool trial, int sequenceDepth) ; --void structarray2sequence(gdcm::SequenceOfItems & sq, Octave_map * om, bool trial, int sequenceDepth); -+void structarray2sequence(gdcm::SequenceOfItems & sq, octave_map * om, bool trial, int sequenceDepth); - void value2element (gdcm::DataElement * de, const octave_value * ov, gdcm::Tag * tag, const std::string & keyword, bool trial, bool * handled, int sequenceDepth); - void octaveVal2dicomImage(gdcm::ImageWriter *w, octave_value *pixval) ; - void genMinimalMetaData(gdcm::ImageWriter *w, gdcm::File *file); -@@ -132,9 +132,9 @@ - } - gdcm::DataSet ds; - gdcm::FileMetaInformation hds; -- Octave_map om=ov.map_value(); -+ octave_map om=ov.map_value(); - uint32_t skipped = 0; -- for (Octave_map::iterator it = om.begin(); it != om.end(); it++) { -+ for (octave_map::iterator it = om.begin(); it != om.end(); it++) { - std::string keyword(om.key(it)); - Cell cell = om.contents(it); - if (!dicom_is_present(keyword)) { -@@ -179,17 +179,17 @@ - return ; - } - --void structarray2sequence(gdcm::SequenceOfItems & sq, Octave_map * om, bool trial, int sequenceDepth) { -- for (Octave_map::iterator it = om->begin(); it != om->end(); it++) { -+void structarray2sequence(gdcm::SequenceOfItems & sq, octave_map * om, bool trial, int sequenceDepth) { -+ for (octave_map::iterator it = om->begin(); it != om->end(); it++) { - gdcm::Item item; - // item.SetVLToUndefined(); //TODO: does VL need to be set for items that contain datasets? - gdcm::DataSet &nds = item.GetNestedDataSet(); - std::string itemname(om->key(it)); - // TODO: test itemname is something like Item_n. - Cell cell = om->contents(it); -- Octave_map subom = cell(0).map_value(); -+ octave_map subom = cell(0).map_value(); - // octave_stdout << itemname <numel() ; -- Octave_map subom = ov->map_value(); -+ octave_map subom = ov->map_value(); - gdcm::SmartPointer sq = new gdcm::SequenceOfItems(); - try { - structarray2sequence(*sq, &subom, trial, ++sequenceDepth) ; -diff -ur dicom.orig/src/Makefile dicom/src/Makefile ---- dicom.orig/src/Makefile 2015-04-15 21:36:10.000000000 -0400 -+++ dicom/src/Makefile 2015-04-15 21:40:04.000000000 -0400 -@@ -15,10 +15,11 @@ - # Please see the file, "COPYING" for further details of GNU General - # Public License version 3. - -- -+MKOCTFILE ?= mkoctfile -+OCTAVE ?= octave - - INCDIRFLAGS = --LIBDIRFLAGS = -L/usr/local/lib -+LIBDIRFLAGS = - GDCMLIBFLAGS = -lgdcmcharls -lgdcmjpeg8 -lgdcmjpeg12 \ - -lgdcmjpeg16 -lgdcmCommon \ - -lgdcmDICT -lgdcmDSED -lgdcmIOD -lgdcmMSFF -@@ -29,35 +30,35 @@ - - - dicomlookup.oct: dicomdict.o dicomlookup.o -- mkoctfile $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicomlookup.o dicomdict.o -o dicomlookup.oct -+ $(MKOCTFILE) $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicomlookup.o dicomdict.o -o dicomlookup.oct - - dicomdict.oct: dicomdict.o -- mkoctfile $(INCDIRFLAGS) $(DEBUGFLAG) dicomdict.o -+ $(MKOCTFILE) $(INCDIRFLAGS) $(DEBUGFLAG) dicomdict.o - - dicominfo.oct: dicominfo.o dicomdict.o -- mkoctfile $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicominfo.o dicomdict.o -o dicominfo.oct -+ $(MKOCTFILE) $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicominfo.o dicomdict.o -o dicominfo.oct - - dicomwrite.oct: dicomwrite.o dicomdict.o -- mkoctfile $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicomwrite.o dicomdict.o -o dicomwrite.oct -+ $(MKOCTFILE) $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicomwrite.o dicomdict.o -o dicomwrite.oct - - dicomread.oct: dicomread.cpp -- mkoctfile $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicomread.cpp -+ $(MKOCTFILE) $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) dicomread.cpp - - _gendicomdict.oct: _gendicomdict.cpp -- mkoctfile $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) _gendicomdict.cpp -+ $(MKOCTFILE) $(INCDIRFLAGS) $(LIBDIRFLAGS) $(GDCMLIBFLAGS) $(DEBUGFLAG) _gendicomdict.cpp - - - dicominfo.o: dicomdict.h dicominfo.cpp -- mkoctfile -c $(INCDIRFLAGS) $(DEBUGFLAG) dicominfo.cpp -+ $(MKOCTFILE) -c $(INCDIRFLAGS) $(DEBUGFLAG) dicominfo.cpp - - dicomwrite.o: dicomdict.h dicomwrite.cpp -- mkoctfile -c $(INCDIRFLAGS) $(DEBUGFLAG) dicomwrite.cpp -+ $(MKOCTFILE) -c $(INCDIRFLAGS) $(DEBUGFLAG) dicomwrite.cpp - - dicomdict.o: dicomdict.h dicomdict.cpp -- mkoctfile -c $(INCDIRFLAGS) $(DEBUGFLAG) dicomdict.cpp -+ $(MKOCTFILE) -c $(INCDIRFLAGS) $(DEBUGFLAG) dicomdict.cpp - - dicomlookup.o: dicomdict.h dicomlookup.cpp -- mkoctfile -c $(INCDIRFLAGS) $(DEBUGFLAG) dicomlookup.cpp -+ $(MKOCTFILE) -c $(INCDIRFLAGS) $(DEBUGFLAG) dicomlookup.cpp - - clean: - rm -f *.o *.oct *~ -@@ -65,13 +66,14 @@ - test: test_dicominfo test_dicomdict test_dicomread test_dicomlookup - - test_dicominfo: dicominfo.oct -- octave -q --eval "test dicominfo.cpp" -+ $(OCTAVE) -q --eval "test dicominfo.cpp" - - test_dicomdict: dicomdict.oct -- octave -q --eval "test dicomdict.cpp" -+ $(OCTAVE) -q --eval "test dicomdict.cpp" - - test_dicomread: dicomread.oct -- octave -q --eval "test dicomread.cpp" -+ $(OCTAVE) -q --eval "test dicomread.cpp" - - test_dicomlookup: dicomlookup.oct -- octave -q --eval "test dicomlookup.cpp" -\ No newline at end of file -+ $(OCTAVE) -q --eval "test dicomlookup.cpp" -+ -diff -ur dicom.orig/src/dicominfo.cpp dicom/src/dicominfo.cpp ---- dicom.orig/src/dicominfo.cpp 2015-04-15 21:44:32.000000000 -0400 -+++ dicom/src/dicominfo.cpp 2015-04-15 21:47:48.000000000 -0400 -@@ -187,10 +187,10 @@ - gdcm::DataSet &ds = file.GetDataSet(); - gdcm::FileMetaInformation &hds=file.GetHeader(); - -- om.assign("Filename",filename); -+ om.assign("Filename",octave_value(filename)); - char dateStr[TIME_STR_LEN+1]; - getFileModTime(dateStr, filename); -- om.assign("FileModDate", dateStr); -+ om.assign("FileModDate", octave_value(dateStr)); - if(chatty) octave_stdout << "# file info\nFilename:" - << filename << "\nFileModDate:" << dateStr << '\n'; - -@@ -220,7 +220,7 @@ - om->assign(varname.c_str(), ov); - } else { - if (0==varname.length()) return ; -- om->assign(varname.c_str(), "not assigned"); -+ om->assign(varname.c_str(), octave_value("not assigned")); - } - } - -@@ -464,7 +464,7 @@ - subom.assign(key.c_str(), subov); - } else { - if (0==key.length()) continue ; -- subom.assign(key.c_str(), "not assigned"); -+ subom.assign(key.c_str(), octave_value("not assigned")); - } - } - snprintf(item_name_buf,15,"Item_%i",j); diff -r 7f5714e37725 -r 2dbbba3cfa86 src/of-dicom-2-gdcm2.4.patch --- a/src/of-dicom-2-gdcm2.4.patch Thu Feb 23 14:08:40 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -diff -ur dicom.orig/src/dicomdict.cpp dicom/src/dicomdict.cpp ---- dicom.orig/src/dicomdict.cpp 2015-09-27 15:34:20.971531487 -0400 -+++ dicom/src/dicomdict.cpp 2015-09-27 15:36:52.571537114 -0400 -@@ -27,9 +27,9 @@ - #include "octave/oct.h" - #include "octave/load-path.h" - --#include "gdcm-2.0/gdcmDict.h" --#include "gdcm-2.0/gdcmVR.h" --#include "gdcm-2.0/gdcmVM.h" -+#include "gdcm-2.4/gdcmDict.h" -+#include "gdcm-2.4/gdcmVR.h" -+#include "gdcm-2.4/gdcmVM.h" - - #include "dicomdict.h" - -diff -ur dicom.orig/src/dicominfo.cpp dicom/src/dicominfo.cpp ---- dicom.orig/src/dicominfo.cpp 2015-09-27 15:34:20.971531487 -0400 -+++ dicom/src/dicominfo.cpp 2015-09-27 15:37:31.131538545 -0400 -@@ -41,18 +41,18 @@ - #include "octave/oct.h" - #include "octave/ov-struct.h" - --//#include "gdcm-2.0/gdcmSystem.h" --#include "gdcm-2.0/gdcmReader.h" --//#include "gdcm-2.0/gdcmWriter.h" --//#include "gdcm-2.0/gdcmAttribute.h" --#include "gdcm-2.0/gdcmDataSet.h" --//#include "gdcm-2.0/gdcmGlobal.h" --//#include "gdcm-2.0/gdcmDicts.h" --#include "gdcm-2.0/gdcmDict.h" --//#include "gdcm-2.0/gdcmCSAHeader.h" --//#include "gdcm-2.0/gdcmPrivateTag.h" --#include "gdcm-2.0/gdcmVR.h" --#include "gdcm-2.0/gdcmSequenceOfItems.h" -+//#include "gdcm-2.4/gdcmSystem.h" -+#include "gdcm-2.4/gdcmReader.h" -+//#include "gdcm-2.4/gdcmWriter.h" -+//#include "gdcm-2.4/gdcmAttribute.h" -+#include "gdcm-2.4/gdcmDataSet.h" -+//#include "gdcm-2.4/gdcmGlobal.h" -+//#include "gdcm-2.4/gdcmDicts.h" -+#include "gdcm-2.4/gdcmDict.h" -+//#include "gdcm-2.4/gdcmCSAHeader.h" -+//#include "gdcm-2.4/gdcmPrivateTag.h" -+#include "gdcm-2.4/gdcmVR.h" -+#include "gdcm-2.4/gdcmSequenceOfItems.h" - - #include "dicomdict.h" - -diff -ur dicom.orig/src/dicomlookup.cpp dicom/src/dicomlookup.cpp ---- dicom.orig/src/dicomlookup.cpp 2015-09-27 15:34:20.971531487 -0400 -+++ dicom/src/dicomlookup.cpp 2015-09-27 15:37:07.223537658 -0400 -@@ -20,9 +20,9 @@ - - #include "octave/oct.h" - --#include "gdcm-2.0/gdcmDict.h" --#include "gdcm-2.0/gdcmVR.h" --#include "gdcm-2.0/gdcmVM.h" -+#include "gdcm-2.4/gdcmDict.h" -+#include "gdcm-2.4/gdcmVR.h" -+#include "gdcm-2.4/gdcmVM.h" - - #include "dicomdict.h" - -diff -ur dicom.orig/src/dicomread.cpp dicom/src/dicomread.cpp ---- dicom.orig/src/dicomread.cpp 2015-09-27 15:34:20.971531487 -0400 -+++ dicom/src/dicomread.cpp 2015-09-27 15:37:53.435539373 -0400 -@@ -24,7 +24,7 @@ - - #include "octave/oct.h" - #include --#include "gdcm-2.0/gdcmImageReader.h" -+#include "gdcm-2.4/gdcmImageReader.h" - - #define DICOM_ERR -1 - #define DICOM_OK 0 -diff -ur dicom.orig/src/dicomwrite.cpp dicom/src/dicomwrite.cpp ---- dicom.orig/src/dicomwrite.cpp 2015-09-27 15:34:20.971531487 -0400 -+++ dicom/src/dicomwrite.cpp 2015-09-27 15:38:05.403539817 -0400 -@@ -21,11 +21,11 @@ - #include "octave/oct.h" - #include "octave/ov-struct.h" - --#include "gdcm-2.0/gdcmDictEntry.h" --#include "gdcm-2.0/gdcmImage.h" --#include "gdcm-2.0/gdcmImageWriter.h" --#include "gdcm-2.0/gdcmFileDerivation.h" --#include "gdcm-2.0/gdcmUIDGenerator.h" -+#include "gdcm-2.4/gdcmDictEntry.h" -+#include "gdcm-2.4/gdcmImage.h" -+#include "gdcm-2.4/gdcmImageWriter.h" -+#include "gdcm-2.4/gdcmFileDerivation.h" -+#include "gdcm-2.4/gdcmUIDGenerator.h" - - #include "dicomdict.h" - -diff -ur dicom.orig/src/_gendicomdict.cpp dicom/src/_gendicomdict.cpp ---- dicom.orig/src/_gendicomdict.cpp 2015-09-27 15:34:20.971531487 -0400 -+++ dicom/src/_gendicomdict.cpp 2015-09-27 15:38:22.687540459 -0400 -@@ -28,17 +28,17 @@ - - #include "octave/oct.h" - --#include "gdcm-2.0/gdcmSystem.h" --#include "gdcm-2.0/gdcmReader.h" --#include "gdcm-2.0/gdcmWriter.h" --#include "gdcm-2.0/gdcmAttribute.h" --#include "gdcm-2.0/gdcmDataSet.h" --#include "gdcm-2.0/gdcmGlobal.h" --#include "gdcm-2.0/gdcmDicts.h" --#include "gdcm-2.0/gdcmDict.h" --#include "gdcm-2.0/gdcmCSAHeader.h" --#include "gdcm-2.0/gdcmPrivateTag.h" --#include "gdcm-2.0/gdcmVR.h" -+#include "gdcm-2.4/gdcmSystem.h" -+#include "gdcm-2.4/gdcmReader.h" -+#include "gdcm-2.4/gdcmWriter.h" -+#include "gdcm-2.4/gdcmAttribute.h" -+#include "gdcm-2.4/gdcmDataSet.h" -+#include "gdcm-2.4/gdcmGlobal.h" -+#include "gdcm-2.4/gdcmDicts.h" -+#include "gdcm-2.4/gdcmDict.h" -+#include "gdcm-2.4/gdcmCSAHeader.h" -+#include "gdcm-2.4/gdcmPrivateTag.h" -+#include "gdcm-2.4/gdcmVR.h" - - #define OCT_FN_NAME _gendicomdict - #define QUOTED_(x) #x diff -r 7f5714e37725 -r 2dbbba3cfa86 src/of-dicom.mk --- a/src/of-dicom.mk Thu Feb 23 14:08:40 2017 -0500 +++ b/src/of-dicom.mk Thu Feb 23 14:08:41 2017 -0500 @@ -3,14 +3,20 @@ PKG := of-dicom $(PKG)_IGNORE := -$(PKG)_VERSION := 0.1.1 -$(PKG)_CHECKSUM := dfb7eccf6ccc39e52c27a5d885984eaa3a55d3d4 +$(PKG)_VERSION := 0.2.0 +$(PKG)_CHECKSUM := 46d4be1f9f822451e8fd415fbea4c3d24aaba5db $(PKG)_REMOTE_SUBDIR := -$(PKG)_SUBDIR := dicom +$(PKG)_SUBDIR := dicom-$($(PKG)_VERSION) $(PKG)_FILE := dicom-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/octave/$($(PKG)_FILE)?download $(PKG)_DEPS := gdcm cmake +ifeq ($(MXE_NATIVE_BUILD),no) +$(PKG)_OPTIONS := CMAKE_BINARY="cmake -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)'" +else +$(PKG)_OPTIONS := +endif + define $(PKG)_UPDATE $(WGET) -q -O- 'http://$(SOURCEFORGE_MIRROR)/projects/octave/files/Octave%20Forge%20Packages/Individual%20Package%20Releases/' | \ $(SED) -n 's,.*title="dicom-\([0-9][^"]*\).tar.gz".*,\1,p' | \ @@ -18,5 +24,5 @@ endef define $(PKG)_BUILD - $(OCTAVE_FORGE_PKG_BUILD) + $(call OCTAVE_FORGE_PKG_BUILD,$(1),$(2),$(3),$($(PKG)_OPTIONS)) endef