Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  2 Mar 2011 17:15:02 +0100 (CET)
From:      Guido Falsi <mad@madpilot.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/155198: New port: graphics/amide Medical Imaging Data Examiner
Message-ID:  <20110302161502.E0987199A@megatron.madpilot.net>
Resent-Message-ID: <201103021620.p22GKAdR043203@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         155198
>Category:       ports
>Synopsis:       New port: graphics/amide Medical Imaging Data Examiner
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 02 16:20:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Guido Falsi
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 8.2-STABLE FreeBSD 8.2-STABLE #25: Sun Feb 27 13:06:39 CET 2011 root@megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON amd64

>Description:

I had a need to look at some medical DCOM files. I found there was
nothing covering my needs in the ports tree, so I ported this
software. My special need was to look at a Magnetic Resonance.

>From the website:

AMIDE is a competely free tool for viewing, analyzing, and registering
volumetric medical imaging data sets. It's been written on top of
GTK+, and runs on any system that supports this toolkit.


BTW I plainly commented out a part of the code which I could not
adapt to the new version of dcmtk. Suggestions from anyone with
more insight about this toolkit are welcome.

The commented out part is this (from files/patch-src-dcmtk_interface.cc):

 #ifdef AMIDE_DEBUG  
-  dcm_dir.enableVerboseMode(TRUE);
-  dcm_dir.setLogStream(&ofConsole);
+// These are not defined in the latest dcmtk and could not find substitutes.
+//  dcm_dir.enableVerboseMode(TRUE);
+//  dcm_dir.setLogStream(&ofConsole);
 #endif


>How-To-Repeat:

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	amide
#	amide/pkg-plist
#	amide/files
#	amide/files/patch-src-dcmtk_interface.cc
#	amide/files/patch-src-mpeg_encode.c
#	amide/files/patch-configure
#	amide/files/patch-src-ui_common.c
#	amide/distinfo
#	amide/Makefile
#	amide/pkg-descr
#
echo c - amide
mkdir -p amide > /dev/null 2>&1
echo x - amide/pkg-plist
sed 's/^X//' >amide/pkg-plist << '78fb43cec2a4789dedc6b9c63d8d0ee4'
Xbin/amide
Xshare/applications/amide.desktop
Xshare/gnome/help/amide/C/amide.xml
Xshare/gnome/help/amide/C/figures/amide_main_window.png
Xshare/gnome/help/amide/C/figures/study_tree.png
Xshare/gnome/help/amide/C/legal.xml
Xshare/gnome/help/amide/es/amide.xml
Xshare/gnome/help/amide/es/figures/amide_main_window.png
Xshare/gnome/help/amide/es/figures/study_tree.png
Xshare/gnome/help/amide/es/legal.xml
Xshare/gtk-doc/html/amitk/AmitkWidgets.html
Xshare/gtk-doc/html/amitk/SpaceObjects.html
Xshare/gtk-doc/html/amitk/amitk-AmitkCanvas.html
Xshare/gtk-doc/html/amitk/amitk-AmitkColorTableMenu.html
Xshare/gtk-doc/html/amitk/amitk-AmitkDataSet.html
Xshare/gtk-doc/html/amitk/amitk-AmitkFiducialMark.html
Xshare/gtk-doc/html/amitk/amitk-AmitkLineProfile.html
Xshare/gtk-doc/html/amitk/amitk-AmitkObject.html
Xshare/gtk-doc/html/amitk/amitk-AmitkObjectDialog.html
Xshare/gtk-doc/html/amitk/amitk-AmitkProgressDialog.html
Xshare/gtk-doc/html/amitk/amitk-AmitkRawData.html
Xshare/gtk-doc/html/amitk/amitk-AmitkRoi.html
Xshare/gtk-doc/html/amitk/amitk-AmitkSpace.html
Xshare/gtk-doc/html/amitk/amitk-AmitkSpaceEdit.html
Xshare/gtk-doc/html/amitk/amitk-AmitkStudy.html
Xshare/gtk-doc/html/amitk/amitk-AmitkThresholdsDialog.html
Xshare/gtk-doc/html/amitk/amitk-AmitkTreeView.html
Xshare/gtk-doc/html/amitk/amitk-AmitkVolume.html
Xshare/gtk-doc/html/amitk/amitk-amitk-canvas-object.html
Xshare/gtk-doc/html/amitk/amitk-amitk-color-table.html
Xshare/gtk-doc/html/amitk/amitk-amitk-common.html
Xshare/gtk-doc/html/amitk/amitk-amitk-filter.html
Xshare/gtk-doc/html/amitk/amitk-amitk-point.html
Xshare/gtk-doc/html/amitk/amitk-amitk-type.html
Xshare/gtk-doc/html/amitk/amitk-theory.html
Xshare/gtk-doc/html/amitk/amitk.devhelp
Xshare/gtk-doc/html/amitk/amitk.devhelp2
Xshare/gtk-doc/html/amitk/amitk_base.html
Xshare/gtk-doc/html/amitk/amitk_intro.html
Xshare/gtk-doc/html/amitk/amitk_objects.html
Xshare/gtk-doc/html/amitk/ch01.html
Xshare/gtk-doc/html/amitk/home.png
Xshare/gtk-doc/html/amitk/index.html
Xshare/gtk-doc/html/amitk/index.sgml
Xshare/gtk-doc/html/amitk/left.png
Xshare/gtk-doc/html/amitk/right.png
Xshare/gtk-doc/html/amitk/style.css
Xshare/gtk-doc/html/amitk/up.png
X%%NLS%%share/locale/zh_CN/LC_MESSAGES/amide.mo
Xshare/omf/amide/amide-C.omf
Xshare/omf/amide/amide-es.omf
Xshare/pixmaps/amide_logo.png
Xshare/pixmaps/amide_file_logo.png
X@dirrm share/gtk-doc/html/amitk
X@dirrm share/gnome/help/amide/es/figures
X@dirrm share/gnome/help/amide/es
X@dirrm share/gnome/help/amide/C/figures
X@dirrm share/gnome/help/amide/C
X@dirrm share/gnome/help/amide
X@dirrm share/omf/amide
78fb43cec2a4789dedc6b9c63d8d0ee4
echo c - amide/files
mkdir -p amide/files > /dev/null 2>&1
echo x - amide/files/patch-src-dcmtk_interface.cc
sed 's/^X//' >amide/files/patch-src-dcmtk_interface.cc << 'cc1f306257c8a737c71ba908e7afb0a1'
X--- src/dcmtk_interface.cc.orig	2009-12-14 05:53:11.000000000 +0100
X+++ src/dcmtk_interface.cc	2011-02-11 10:59:18.612565854 +0100
X@@ -32,7 +32,7 @@
X #include <unistd.h>
X #endif
X #include "dcmtk_interface.h" 
X-#include "dcddirif.h"     /* for class DicomDirInterface */
X+#include "dcmtk/dcmdata/dcddirif.h"     /* for class DicomDirInterface */
X #include <dirent.h>
X #include <sys/stat.h>
X #include "amitk_data_set_DOUBLE_0D_SCALING.h"
X@@ -44,7 +44,8 @@
X #undef PACKAGE_STRING
X #undef PACKAGE_TARNAME
X #undef PACKAGE_VERSION
X-#include <dctk.h>
X+#include "amide_config.h"
X+#include <dcmtk/dcmdata/dctk.h>
X //#include <dcostrmb.h>
X const gchar * dcmtk_version = OFFIS_DCMTK_VERSION;
X 
X@@ -188,7 +189,7 @@
X   }
X   dim.y = return_uint16;
X 
X-  if (dcm_dataset->findAndGetUint16(DCM_Planes, return_uint16).bad()) 
X+  if (dcm_dataset->findAndGetUint16(DCM_RETIRED_Planes, return_uint16).bad()) 
X     dim.z = 1;
X   else
X     dim.z = return_uint16;
X@@ -352,7 +353,7 @@
X   if (dcm_dataset->findAndGetString(DCM_PatientID, return_str, OFTrue).good()) 
X     amitk_data_set_set_subject_id(ds, return_str);
X 
X-  if (dcm_dataset->findAndGetFloat64(DCM_PatientsWeight, return_float64).good()) {
X+  if (dcm_dataset->findAndGetFloat64(DCM_PatientWeight, return_float64).good()) {
X     amitk_data_set_set_subject_weight(ds, return_float64);
X     amitk_data_set_set_displayed_weight_unit(ds, AMITK_WEIGHT_UNIT_KILOGRAM);
X   }
X@@ -429,7 +430,7 @@
X     }
X   }
X 
X-  if (dcm_dataset->findAndGetString(DCM_PatientsName, return_str, OFTrue).good()) {
X+  if (dcm_dataset->findAndGetString(DCM_PatientName, return_str, OFTrue).good()) {
X       if (AMITK_OBJECT_NAME(ds) == NULL)
X 	amitk_object_set_name(AMITK_OBJECT(ds), return_str);
X       amitk_data_set_set_subject_name(ds, return_str);
X@@ -495,7 +496,7 @@
X     }
X   }
X 
X-  if (dcm_dataset->findAndGetString(DCM_PatientsBirthDate, return_str, OFTrue).good()) 
X+  if (dcm_dataset->findAndGetString(DCM_PatientBirthDate, return_str, OFTrue).good()) 
X     amitk_data_set_set_subject_dob(ds, return_str);
X 
X   /* because of how the dicom coordinates are setup, after reading in the patient slices, 
X@@ -1257,7 +1258,7 @@
X   if (return_str != NULL) 
X       info->patient_id = g_strdup(return_str);
X 
X-  dcm_dataset->findAndGetString(DCM_PatientsName, return_str, OFTrue);
X+  dcm_dataset->findAndGetString(DCM_PatientName, return_str, OFTrue);
X   if (return_str != NULL) 
X       info->patient_name = g_strdup(return_str);
X 
X@@ -1537,7 +1538,7 @@
X 
X   /* go through the whole directory */
X   while ((patient_record = dcm_root_record->nextSub(patient_record)) != NULL) {
X-    patient_record->findAndGetString(DCM_PatientsName, record_name[0]);
X+    patient_record->findAndGetString(DCM_PatientName, record_name[0]);
X     patient_record->findAndGetString(DCM_PatientID, patient_id, OFTrue);
X 
X 
X@@ -1802,8 +1803,9 @@
X   }
X 
X #ifdef AMIDE_DEBUG  
X-  dcm_dir.enableVerboseMode(TRUE);
X-  dcm_dir.setLogStream(&ofConsole);
X+// These are not defined in the latest dcmtk and could not find substitutes.
X+//  dcm_dir.enableVerboseMode(TRUE);
X+//  dcm_dir.setLogStream(&ofConsole);
X #endif
X 
X   /* create the DICOMDIR, unless already made in which case we'll append to it */
X@@ -1905,15 +1907,15 @@
X 
X   /* other stuff */
X   if (AMITK_DATA_SET_SUBJECT_NAME(ds) != NULL) 
X-    insert_str(dcm_ds,DCM_PatientsName, AMITK_DATA_SET_SUBJECT_NAME(ds));
X+    insert_str(dcm_ds,DCM_PatientName, AMITK_DATA_SET_SUBJECT_NAME(ds));
X   if (AMITK_DATA_SET_SUBJECT_ID(ds) != NULL) 
X     insert_str(dcm_ds,DCM_PatientID, AMITK_DATA_SET_SUBJECT_ID(ds));
X   if (AMITK_DATA_SET_SUBJECT_DOB(ds) != NULL) 
X-    insert_str(dcm_ds,DCM_PatientsBirthDate, AMITK_DATA_SET_SUBJECT_DOB(ds));
X+    insert_str(dcm_ds,DCM_PatientBirthDate, AMITK_DATA_SET_SUBJECT_DOB(ds));
X   if (AMITK_OBJECT_NAME(ds) != NULL)
X     insert_str(dcm_ds,DCM_StudyDescription, AMITK_OBJECT_NAME(ds));
X   insert_double(dcm_ds,DCM_RadionuclideTotalDose, AMITK_DATA_SET_INJECTED_DOSE(ds));
X-  insert_double(dcm_ds,DCM_PatientsWeight, AMITK_DATA_SET_SUBJECT_WEIGHT(ds));
X+  insert_double(dcm_ds,DCM_PatientWeight, AMITK_DATA_SET_SUBJECT_WEIGHT(ds));
X 
X   switch(AMITK_DATA_SET_SUBJECT_ORIENTATION(ds)) {
X   case AMITK_SUBJECT_ORIENTATION_SUPINE_HEADFIRST:
X@@ -1949,7 +1951,7 @@
X   case AMITK_MODALITY_PET:
X     insert_str(dcm_ds,DCM_Modality, "PT");
X     dcm_metainfo->putAndInsertString(DCM_MediaStorageSOPClassUID,
X-				     UID_PETImageStorage);
X+				     UID_EnhancedPETImageStorage);
X     break;
X   case AMITK_MODALITY_SPECT:
X     insert_str(dcm_ds,DCM_Modality, "ST");
cc1f306257c8a737c71ba908e7afb0a1
echo x - amide/files/patch-src-mpeg_encode.c
sed 's/^X//' >amide/files/patch-src-mpeg_encode.c << '3725c3aad1f588c3da24995d709ac726'
X--- src/mpeg_encode.c.orig	2009-11-16 07:55:52.000000000 +0100
X+++ src/mpeg_encode.c	2011-02-08 16:18:47.640994869 +0100
X@@ -141,7 +141,7 @@
X /* -------------------------------------------------------- */
X #ifdef AMIDE_FFMPEG_SUPPORT
X 
X-#include <ffmpeg/libavcodec/avcodec.h>
X+#include <libavcodec/avcodec.h>
X 
X 
X typedef struct {
3725c3aad1f588c3da24995d709ac726
echo x - amide/files/patch-configure
sed 's/^X//' >amide/files/patch-configure << 'edf246f5949e6a0eb1ff96eb9630b11a'
X--- configure.orig	2009-12-09 07:35:12.000000000 +0100
X+++ configure	2011-02-10 18:25:18.165872253 +0100
X@@ -17889,13 +17889,13 @@
X                DATADIRNAME=share
X else
X   CATOBJEXT=.mo
X-               DATADIRNAME=lib
X+               DATADIRNAME=share
X fi
X 
X 	    ;;
X 	    *)
X 	    CATOBJEXT=.mo
X-            DATADIRNAME=lib
X+            DATADIRNAME=share
X 	    ;;
X 	    esac
X fi
X@@ -18684,12 +18684,12 @@
X if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then
X   DATADIRNAME=share
X else
X-  DATADIRNAME=lib
X+  DATADIRNAME=share
X fi
X 
X     ;;
X     *)
X-    DATADIRNAME=lib
X+    DATADIRNAME=share
X     ;;
X     esac
X fi
X@@ -19625,7 +19625,7 @@
X   $as_echo_n "(cached) " >&6
X else
X   ac_check_lib_save_LIBS=$LIBS
X-LIBS="-ldcmdata -lofstd  -lz -L/usr/local/dicom/lib -L/sw/lib $THREAD_LIBS $LIBS"
X+LIBS="-ldcmdata -lofstd -loflog -lz -L/usr/local/lib $THREAD_LIBS $LIBS"
X cat >conftest.$ac_ext <<_ACEOF
X /* confdefs.h.  */
X _ACEOF
X@@ -20391,8 +20391,8 @@
X 
X if (test $enable_libdcmdata = yes) && (test $FOUND_DCMDATA = yes); then
X 	echo "Compiling with DCMTK support for DICOM files"
X-	AMIDE_LIBDCMDATA_LIBS="-L/usr/local/dicom/lib -ldcmdata -lofstd -lz $THREAD_LIBS"
X-	AMIDE_LIBDCMDATA_CFLAGS="-I/usr/local/dicom/include/dcmtk/dcmdata -I/usr/local/dicom/include/dcmtk/ofstd -I/usr/local/dicom/include -I/usr/include/dcmtk/dcmdata -I/usr/local/include/dcmtk/ofstd -I/sw/include/dcmtk/dcmdata -I/sw/include/dcmtk/ofstd -I/sw/include/dcmtk"
X+	AMIDE_LIBDCMDATA_LIBS="-L/usr/local/lib -ldcmdata -lofstd -loflog -lz $THREAD_LIBS"
X+	AMIDE_LIBDCMDATA_CFLAGS="-I/usr/local/include"
X 
X 
X 
edf246f5949e6a0eb1ff96eb9630b11a
echo x - amide/files/patch-src-ui_common.c
sed 's/^X//' >amide/files/patch-src-ui_common.c << '4e358bc0aa0d9570a2851f9e28f67eda'
X--- src/ui_common.c.orig	2009-11-16 06:00:11.000000000 +0100
X+++ src/ui_common.c	2011-02-08 16:21:18.283127798 +0100
X@@ -46,7 +46,7 @@
X #include <medcon.h>
X #endif
X #ifdef AMIDE_FFMPEG_SUPPORT
X-#include <ffmpeg/libavcodec/avcodec.h>
X+#include <libavcodec/avcodec.h>
X #endif
X #ifdef AMIDE_LIBFAME_SUPPORT
X #include <fame_version.h>
4e358bc0aa0d9570a2851f9e28f67eda
echo x - amide/distinfo
sed 's/^X//' >amide/distinfo << 'ad578294527550f12af59332c0ec2462'
XSHA256 (amide-0.9.2.tgz) = bbe230b7aef3c65ef2014d561a09d97b96e50ec4f1a09c16b4de751974ff01be
XSIZE (amide-0.9.2.tgz) = 1476952
ad578294527550f12af59332c0ec2462
echo x - amide/Makefile
sed 's/^X//' >amide/Makefile << 'd8e16f3c873a37b8d1f71e59a739bb03'
X# New ports collection makefile for:   amide
X# Date created:        8 Febrary 2011
X# Whom:                Guido Falsi <mad@madpilot.net>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	amide
XPORTVERSION=	0.9.2
XCATEGORIES=	graphics
XMASTER_SITES=	SF
XEXTRACT_SUFX=	.tgz
X
XMAINTAINER=	mad@madpilot.net
XCOMMENT=	Medical Imaging Data Examiner
X
XLICENSE=	GPLv2
XLICENSE_FILE=	${WRKSRC}/COPYING
X
XUSE_GMAKE=	yes
XUSE_GNOME=	gtk20 libgnomecanvas libgnomeui libxml2
XGNU_CONFIGURE=	yes
XUSE_GETTEXT=	yes
XMAKE_JOBS_UNSAFE=	yes
XINSTALLS_OMF=	yes
XMAN1=		amide.1
X
XRUN_DEPENDS+=	medcon:${PORTSDIR}/graphics/xmedcon
X
XOPTIONS=	XMEDCON	"Use xmedcon"	on \
X		DCMTK	"Use dcmtk"	on \
X		FFMPEG	"Use ffmpeg"	on \
X		GSL	"Use gsl"	on
X
X.include <bsd.port.pre.mk>
X
X.if exists(${LOCALBASE}/lib/libmdc.so) || defined(WITH_XMEDCON)
XLIB_DEPENDS+=	mdc.2:${PORTSDIR}/graphics/xmedcon
X.endif
X
X.if exists(${LOCALBASE}/lib/libdcmimage.so) || defined(WITH_DCMTK)
XLIB_DEPENDS+=	dcmimage.3:${PORTSDIR}/devel/dcmtk
X.endif
X
X.if exists(${LOCALBASE}/lib/libavcodec.so) || defined(WITH_FFMPEG)
XLIB_DEPENDS+=	avcodec.1:${PORTSDIR}/multimedia/ffmpeg
X.endif
X
X.if exists(${LOCALBASE}/lib/libgsl.so) || defined(WITH_GSL)
XLIB_DEPENDS+=	gsl.15:${PORTSDIR}/math/gsl
X.endif
X
X.if defined(WITHOUT_NLS)
XCONFIGURE_ARGS+=	--disable-nls
XPLIST_SUB+=	NLS='@comment '
X.else
XPLIST_SUB+=	NLS=''
X.endif
X
X.include <bsd.port.post.mk>
d8e16f3c873a37b8d1f71e59a739bb03
echo x - amide/pkg-descr
sed 's/^X//' >amide/pkg-descr << 'bfc5be818aec573dcc3d1ecf2eb218f0'
XAMIDE is a competely free tool for viewing, analyzing, and registering
Xvolumetric medical imaging data sets. It's been written on top of
XGTK+, and runs on any system that supports this toolkit
X
XWWW: http://amide.sourceforge.net/
X
X--
XGuido Falsi <mad@madpilot.net>
bfc5be818aec573dcc3d1ecf2eb218f0
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110302161502.E0987199A>