From thomas.funck at mail.mcgill.ca Mon Apr 4 10:24:03 2011 From: thomas.funck at mail.mcgill.ca (Thomas Funck) Date: Mon, 4 Apr 2011 14:24:03 +0000 Subject: [MINC-users] MINC-users Digest, Vol 68, Issue 24 In-Reply-To: References: Message-ID: <53F3FD0032C9CC4BA836E8F0FC289065D202@EXMBX2010-2.campus.MCGILL.CA> Hi, I'm having trouble creating a 4 dimensional volume with the function micreate_volume, the function returns -1 whenever I try to use it . I'm basically using the exact same code as is contained in the minc2 tutorials, except that I changed the type from ubyte to double (it doesn't work with either type). The strange thing is that the function works fine for 3 dimensional volumes. I'm sure that the dimensions are set correctly so that isn't the problem. Any ideas what's causing this? Many thanks, Thomas P.S. Here are the lines of code in question: mihandle_t minc_volume, new_volume; midimhandle_t dimensions[4]; unsigned int sizes[4]; miopen_volume(argv[1], MI2_OPEN_READ, &minc_volume); miget_volume_dimensions(minc_volume, MI_DIMCLASS_ANY, MI_DIMATTR_ALL, MI_DIMORDER_FILE, 4, dimensions); miget_dimension_sizes(dimensions, 4, sizes); micreate_volume(argv[2], 4, dimensions, MI_TYPE_DOUBLE,MI_CLASS_REAL, NULL, &new_volume) From MKeaser at umaryland.edu Mon Apr 4 12:52:41 2011 From: MKeaser at umaryland.edu (Keaser, Michael L) Date: Mon, 4 Apr 2011 12:52:41 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> , Message-ID: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> Andrew, I'm still having trouble installing Display. When you say "copy and paste the last line of the build (when Display is made) and then run it without the liibtool part", which specific "build" file are you referring to where we can make this edit? Thanks, Michael ________________________________________ From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] Sent: Tuesday, March 29, 2011 8:16 AM To: MINC users mailing list Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc If this is the same "bug" that I have been bitten by it's to do with libtool and the way bicpl is linked (or not as the case often turns out to be) with libnetpbm. If you run make in the Display directory, copy and paste the last line of the build (when Display is made) and then run it without the libtool part. turn $ libtool gcc into $ gcc and in most cases Display will be made. YMMV but this is what I have seen but haven't got to the bottom of yet. a On Tue, Mar 29, 2011 at 09:34, Mishkin Derakhshan wrote: > Then I tried debugging: > Inside the source dir of Display-1.5.0 > ./configure --prefix=/usr/local/bic --with-build-path=/usr/local/bic > --with-minc2 --with-x > make _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From anthonin at bic.mni.mcgill.ca Mon Apr 4 21:15:03 2011 From: anthonin at bic.mni.mcgill.ca (Anthonin REILHAC) Date: Mon, 4 Apr 2011 21:15:03 -0400 (EDT) Subject: [MINC-users] ecattominc seg fault on 64-bit Lucid In-Reply-To: References: Message-ID: I still see this issue once in a while. I fixed the bug for 64 bits machine some years ago. But it seems that the correct version is still notincluded in the distros. to whom should I send the correct version? Cheers, Anthonin Reilhac McConnell Brain Imaging Centre, WB2B Montreal Neurological Institute 3801 University Montreal, Quebec, Canada phone: (514) 398 4965 On Tue, 4 Jan 2011, EJ Nikelski wrote: > Hi All, > > I've been using ecattominc to convert 7-frame dynamic volumes > (acquired at the MNI) to minc for some time, without any trouble. > Today, however, I installed the minc tools on to a relatively fresh > 64-bit Lucid system, and I'm now getting seg faults (minc-2.1.00). The > abort occurs consistently while opening the ecat file and appears to > occur within the "/* Save the offsets */" loop of function > ecat_read_directory (ecat_file.c). The precise loop number at which > the seg fault occurs is variable, suggesting that this is related > either to an uninitialized variable, or some 32-bit versus 64-bit > issue (the same ecat volume does not cause a seg fault on our 32-bit > system). > > Any ideas or suggestions? I'm willing to test any suggested code > modifications. I've already done a fair bit of poking around and > re-compiling, but my knowledge of ecat header internals is lacking. > > Thanks, > > -jim > > -- > ================================= > Jim Nikelski, Ph.D. > Postdoctoral Research Fellow > Bloomfield Centre for Research in Aging > Lady Davis Institute for Medical Research > Sir Mortimer B. Davis - Jewish General Hospital > McGill University > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Mon Apr 4 21:35:07 2011 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 5 Apr 2011 11:35:07 +1000 Subject: [MINC-users] ecattominc seg fault on 64-bit Lucid In-Reply-To: References: Message-ID: > I still see this issue once in a while. > I fixed the bug for 64 bits machine some years ago. > But it seems that the correct version is still notincluded in the distros. > to whom should I send the correct version? Hrm, well this might be a good time to mention this: https://github.com/andrewjanke/minc MINC is/will be/probably eventually shifting to GIT on NITRC so that others can more easily contribute. As I trial I have imported the entire of the MINC CVS history to github. For now it is the primary source of MINC and I will be syncing changes made there back to the MINC CVS at the BIC. So please check the version on github, if it is still wrong then by all means add yourself as a user on github, send me the name and I will add you as a developer. We (minc devs) are aiming for a more open MINC from here on in so hopefully a change to github or NITRC will lower the bar for others to contribute. Thanks -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Brisbane->Australia +61 (402) 700 883 From mishkind at gmail.com Mon Apr 4 21:44:40 2011 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Mon, 4 Apr 2011 21:44:40 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> Message-ID: Hi Keaser if you did something like this for vlad's Makefile: make Display PREFIX=/usr/local/bic TEMP=$HOME/temp then try this cd $HOME/src/Display-1.5.0 ./configure --prefix=/usr/local/bic --with-build-path=/usr/local/bic --with-minc2 --with-x make (lots of screen output) The last line for me is: /bin/bash ./libtool --tag=CC --mode=link gcc -g -O2 -L/usr/local/bic/lib -o Display dummy.o main/main.o main/display.o main/event_loop.o main/graphics.o main/three_d.o main/transforms.o atlas/atlas.o input_files/input_files.o input_files/volume_file.o callbacks/atlas.o callbacks/call_globals.o callbacks/colour_coding.o callbacks/file.o callbacks/line_ops.o callbacks/object_ops.o callbacks/marker_ops.o callbacks/polygon_ops.o callbacks/quit.o callbacks/regions.o callbacks/render_ops.o callbacks/segmenting.o callbacks/surf_segmenting.o callbacks/surface_curves.o callbacks/surface_extract.o callbacks/view_ops.o callbacks/volume_ops.o callbacks/volume_transform_ops.o current_obj/current_obj.o edit_surface/connected.o edit_surface/edit.o edit_surface/segment.o images/images.o markers/markers.o surface_extraction/boundary_extraction.o surface_extraction/data_structs.o surface_extraction/init_surface.o surface_extraction/extract.o surface_extraction/surface.o surface_extraction/surface_events.o voxel_scan/scan_objects.o events/change_markers.o events/clip_plane.o events/film_loop.o events/magnify.o events/mouse.o events/mouse_trans.o events/pick_object.o events/pick_view.o events/rotate_slice.o events/spaceball.o events/virt_sb.o events/window_man.o events/utilities.o immediate_mode/draw_immed.o intersect/ray_polygons.o intersect/plane_polygons.o cursor/cursor.o cursor/cursor_icon.o menu/build_menu.o menu/cursor_pos.o menu/menu.o menu/input_menu.o menu/selected.o menu/text.o cursor_contours/contours.o segmenting/cut_neighbours.o segmenting/painting.o segmenting/segmenting.o segmenting/segment_polygons.o slice_window/colour_bar.o slice_window/colour_coding.o slice_window/crop.o slice_window/draw_slice.o slice_window/histogram.o slice_window/pick_angle.o slice_window/quadmesh.o slice_window/slice.o slice_window/slice_3d.o slice_window/slice_events.o slice_window/undo.o slice_window/view.o surface_curves/closest_line.o surface_curves/events.o surface_curves/edge_distance.o tubes/convert_lines.o structures/action_table.o structures/fit_view.o structures/lights.o structures/render.o structures/view.o structures/window.o Graphics/libbicgl.a -lGL -lm -lGLU -lGL -lm -lglut -lSM -lICE -lXmu -lXi -lGLU -lGL -lm -lbicpl -lvolume_io2 -lminc2 -lhdf5 -lz -lnetcdf -lm -lm -lbicpl -lvolume_io2 -lminc2 -lhdf5 -lz -lnetcdf -lm -lm So you would just do: gcc -g -O2 -L/usr/local/bic/lib -o Display dummy.o main/main.o main/display.o main/event_loop.o main/graphics.o main/three_d.o main/transforms.o atlas/atlas.o input_files/input_files.o input_files/volume_file.o callbacks/atlas.o callbacks/call_globals.o callbacks/colour_coding.o callbacks/file.o callbacks/line_ops.o callbacks/object_ops.o callbacks/marker_ops.o callbacks/polygon_ops.o callbacks/quit.o callbacks/regions.o callbacks/render_ops.o callbacks/segmenting.o callbacks/surf_segmenting.o callbacks/surface_curves.o callbacks/surface_extract.o callbacks/view_ops.o callbacks/volume_ops.o callbacks/volume_transform_ops.o current_obj/current_obj.o edit_surface/connected.o edit_surface/edit.o edit_surface/segment.o images/images.o markers/markers.o surface_extraction/boundary_extraction.o surface_extraction/data_structs.o surface_extraction/init_surface.o surface_extraction/extract.o surface_extraction/surface.o surface_extraction/surface_events.o voxel_scan/scan_objects.o events/change_markers.o events/clip_plane.o events/film_loop.o events/magnify.o events/mouse.o events/mouse_trans.o events/pick_object.o events/pick_view.o events/rotate_slice.o events/spaceball.o events/virt_sb.o events/window_man.o events/utilities.o immediate_mode/draw_immed.o intersect/ray_polygons.o intersect/plane_polygons.o cursor/cursor.o cursor/cursor_icon.o menu/build_menu.o menu/cursor_pos.o menu/menu.o menu/input_menu.o menu/selected.o menu/text.o cursor_contours/contours.o segmenting/cut_neighbours.o segmenting/painting.o segmenting/segmenting.o segmenting/segment_polygons.o slice_window/colour_bar.o slice_window/colour_coding.o slice_window/crop.o slice_window/draw_slice.o slice_window/histogram.o slice_window/pick_angle.o slice_window/quadmesh.o slice_window/slice.o slice_window/slice_3d.o slice_window/slice_events.o slice_window/undo.o slice_window/view.o surface_curves/closest_line.o surface_curves/events.o surface_curves/edge_distance.o tubes/convert_lines.o structures/action_table.o structures/fit_view.o structures/lights.o structures/render.o structures/view.o structures/window.o Graphics/libbicgl.a -lGL -lm -lGLU -lGL -lm -lglut -lSM -lICE -lXmu -lXi -lGLU -lGL -lm -lbicpl -lvolume_io2 -lminc2 -lhdf5 -lz -lnetcdf -lm -lm -lbicpl -lvolume_io2 -lminc2 -lhdf5 -lz -lnetcdf -lm -lm Unfortunately, I still get an error and there is no executable slice_window/crop.o: In function `crop_and_load_volume': /home/mishkin/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' /usr/local/bic/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' /usr/local/bic/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' collect2: ld returned 1 exit status Maybe you will have better luck, or maybe the people much smarter than me will be able to help you. mishkin On Mon, Apr 4, 2011 at 12:52 PM, Keaser, Michael L wrote: > Andrew, > > I'm still having trouble installing Display. > > When you say "copy and paste the last line of the build (when Display is made) and then run it without the liibtool part", which specific "build" file are you referring to where we can make this edit? > > Thanks, > > Michael > > ________________________________________ > From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] > Sent: Tuesday, March 29, 2011 8:16 AM > To: MINC users mailing list > Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > > If this is the same "bug" that I have been bitten by it's to do with > libtool and the way bicpl is linked (or not as the case often turns > out to be) with libnetpbm. > > If you run make in the Display directory, copy and paste the last line > of the build (when Display is made) and then run it without the > libtool part. ?turn > > ? $ libtool gcc > > into > > ? $ gcc > > and in most cases Display will be made. > > YMMV but this is what I have seen but haven't got to the bottom of yet. > > a > > On Tue, Mar 29, 2011 at 09:34, Mishkin Derakhshan wrote: >> Then I tried debugging: >> Inside the source dir of Display-1.5.0 >> ./configure --prefix=/usr/local/bic --with-build-path=/usr/local/bic >> --with-minc2 --with-x >> make > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Mon Apr 4 21:51:17 2011 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 5 Apr 2011 11:51:17 +1000 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> Message-ID: > On Tue, Apr 5, 2011 at 11:44, Mishkin Derakhshan wrote: > Unfortunately, I still get an error and there is no executable > slice_window/crop.o: In function `crop_and_load_volume': > /home/mishkin/src/Display-1.5.0/slice_window/crop.c:165: warning: the > use of `tmpnam' is dangerous, better use `mkstemp' > /usr/local/bic/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined > reference to `ppm_writeppminit' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined > reference to `ppm_allocrow' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined > reference to `ppm_writeppmrow' > /usr/local/bic/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined > reference to `ppm_readppminit' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined > reference to `ppm_allocrow' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined > reference to `ppm_readppmrow' > collect2: ld returned 1 exit status > > Maybe you will have better luck, or maybe the people much smarter than > me will be able to help you. add -lppm to the link line (after -lm is a good spot). This is a libtool issue, when you link with -lbicpl it should then also include -lppm but it doesn't for some reason in all cases. a From MKeaser at umaryland.edu Tue Apr 5 10:56:48 2011 From: MKeaser at umaryland.edu (Keaser, Michael L) Date: Tue, 5 Apr 2011 10:56:48 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> , Message-ID: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> Andrew, Thank you Mishkin for your suggestion. It got me pointed in the right direction. I receive the same error message as you do now. Andrew, where is the "link line" you are referring to? There are few number of lm's. I tried puttng at the very end: gcc -g -O2 -L/usr/local/minc/lib -o Display dummy.o main/main.o main/display.o main/event_loop.o main/graphics.o main/three_d.o main/transforms.o atlas/atlas.o input_files/input_files.o input_files/volume_file.o callbacks/atlas.o callbacks/call_globals.o callbacks/colour_coding.o callbacks/file.o callbacks/line_ops.o callbacks/object_ops.o callbacks/marker_ops.o callbacks/polygon_ops.o callbacks/quit.o callbacks/regions.o callbacks/render_ops.o callbacks/segmenting.o callbacks/surf_segmenting.o callbacks/surface_curves.o callbacks/surface_extract.o callbacks/view_ops.o callbacks/volume_ops.o callbacks/volume_transform_ops.o current_obj/current_obj.o edit_surface/connected.o edit_surface/edit.o edit_surface/segment.o images/images.o markers/markers.o surface_extraction/boundary_extraction.o surface_extraction/data_structs.o surface_extraction/init_surface.o surface_extraction/extract.o surface_extraction/surface.o surface_extraction/surface_events.o voxel_scan/scan_objects.o events/change_markers.o events/clip_plane.o events/film_loop.o events/magnify.o events/mouse.o events/mouse_trans.o events/pick_object.o events/pick_view.o events/rotate_slice.o events/spaceball.o events/virt_sb.o events/window_man.o events/utilities.o immediate_mode/draw_immed.o intersect/ray_polygons.o intersect/plane_polygons.o cursor/cursor.o cursor/cursor_icon.o menu/build_menu.o menu/cursor_pos.o menu/menu.o menu/input_menu.o menu/selected.o menu/text.o cursor_contours/contours.o segmenting/cut_neighbours.o segmenting/painting.o segmenting/segmenting.o segmenting/segment_polygons.o slice_window/colour_bar.o slice_window/colour_coding.o slice_window/crop.o slice_window/draw_slice.o slice_window/histogram.o slice_window/pick_angle.o slice_window/quadmesh.o slice_window/slice.o slice_window/slice_3d.o slice_window/slice_events.o slice_window/undo.o slice_window/view.o surface_curves/closest_line.o surface_curves/events.o surface_curves/edge_distance.o tubes/convert_lines.o structures/action_table.o structures/fit_view.o structures/lights.o structures/render.o structures/view.o structures/window.o Graphics/libbicgl.a -lGL -lm -lGLU -lGL -lm -lglut -lSM -lICE -lXmu -lXi -lGLU -lGL -lm -lbicpl -lvolume_io2 -lminc2 -lhdf5 -lz -lnetcdf -lm -lm -lbicpl -lvolume_io2 -lminc2 -lhdf5 -lz -lnetcdf -lm -lm -lppm And this is the error message I received slice_window/crop.o: In function `crop_and_load_volume': /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' collect2: ld returned 1 exit statu Michael ________________________________________ From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] Sent: Monday, April 04, 2011 9:51 PM To: MINC users mailing list Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > On Tue, Apr 5, 2011 at 11:44, Mishkin Derakhshan wrote: > Unfortunately, I still get an error and there is no executable > slice_window/crop.o: In function `crop_and_load_volume': > /home/mishkin/src/Display-1.5.0/slice_window/crop.c:165: warning: the > use of `tmpnam' is dangerous, better use `mkstemp' > /usr/local/bic/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined > reference to `ppm_writeppminit' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined > reference to `ppm_allocrow' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined > reference to `ppm_writeppmrow' > /usr/local/bic/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined > reference to `ppm_readppminit' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined > reference to `ppm_allocrow' > /home/mishkin/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined > reference to `ppm_readppmrow' > collect2: ld returned 1 exit status > > Maybe you will have better luck, or maybe the people much smarter than > me will be able to help you. add -lppm to the link line (after -lm is a good spot). This is a libtool issue, when you link with -lbicpl it should then also include -lppm but it doesn't for some reason in all cases. a _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From a.janke at gmail.com Tue Apr 5 11:09:33 2011 From: a.janke at gmail.com (Andrew Janke) Date: Wed, 6 Apr 2011 01:09:33 +1000 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> Message-ID: > Thank you Mishkin for your suggestion. It got me pointed in the right direction. I receive the same error message as you do now. > > Andrew, where is the "link line" you are referring to? There are few number of lm's. I tried puttng at the very end: Ah, it will have to go before -lbicpl a From MKeaser at umaryland.edu Tue Apr 5 11:22:59 2011 From: MKeaser at umaryland.edu (Keaser, Michael L) Date: Tue, 5 Apr 2011 11:22:59 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu>, Message-ID: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu> Andrew, Okay, I tried that, but I still get this message: /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' collect2: ld returned 1 exit status Michael ________________________________________ From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] Sent: Tuesday, April 05, 2011 11:09 AM To: MINC users mailing list Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > Thank you Mishkin for your suggestion. It got me pointed in the right direction. I receive the same error message as you do now. > > Andrew, where is the "link line" you are referring to? There are few number of lm's. I tried puttng at the very end: Ah, it will have to go before -lbicpl a _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From baghdadi at phenogenomics.ca Wed Apr 6 09:49:10 2011 From: baghdadi at phenogenomics.ca (Leila Baghdadi) Date: Wed, 6 Apr 2011 09:49:10 -0400 Subject: [MINC-users] FW: MINC-users Digest, Vol 68, Issue 24 Message-ID: <14191403.116921302097750589.JavaMail.root@mail2.phenogenomics.ca> Hello, I just took a quick look at your test code and it seems to me that you are not creating a 4 dimensional volume but trying to load an existing one. either way, there should not be any trouble with the code! For creating a 4D volume, check minc2.0(any version will have this)/libsrc2/test/create-test-images.c I have used 4D volumes in the past and do not recall any problems, if you are trying to load a 4D volume and have difficulty, please let me know the location of it so I can check it out. Leila p.s the test directory "libsrc2/test" of minc2 has a number of very good test code snippet, I think you will find them very useful From a.janke at gmail.com Thu Apr 7 03:09:59 2011 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 7 Apr 2011 17:09:59 +1000 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu> References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu> Message-ID: > Okay, I tried that, but I still get this message: > > > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' > collect2: ld returned 1 exit status ah, ppm_allocrow, did you link bicpl with ppm or netpbm? I am not sure which platform you are compiling this on but on some architectures you have to link with: -lpgm -lpbm a From MKeaser at umaryland.edu Thu Apr 7 10:16:47 2011 From: MKeaser at umaryland.edu (Keaser, Michael L) Date: Thu, 7 Apr 2011 10:16:47 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu>, Message-ID: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D8@UMBEXMBX2.campus.umaryland.edu> Andrew, So are you saying substitute -lpgm -lpbm for the lppm? If so, when I did that, I received this message: /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' collect2: ld returned 1 exit status Michael ________________________________________ From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] Sent: Thursday, April 07, 2011 3:09 AM To: MINC users mailing list Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > Okay, I tried that, but I still get this message: > > > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' > collect2: ld returned 1 exit status ah, ppm_allocrow, did you link bicpl with ppm or netpbm? I am not sure which platform you are compiling this on but on some architectures you have to link with: -lpgm -lpbm a _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From vladimir.fonov at gmail.com Thu Apr 7 11:19:12 2011 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Thu, 07 Apr 2011 11:19:12 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D8@UMBEXMBX2.campus.umaryland.edu> References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu>, <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D8@UMBEXMBX2.campus.umaryland.edu> Message-ID: <4D9DD5F0.3020002@gmail.com> Hello, netpbm version 10.35.74 is build as part of quarantine creation. There should be file libnetpbm.a in /usr/local/minc/lib Keaser, Michael L wrote: > Andrew, > > So are you saying substitute -lpgm -lpbm for the lppm? If so, when I did that, I received this message: > > /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' > collect2: ld returned 1 exit status > > > Michael > ________________________________________ > From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] > Sent: Thursday, April 07, 2011 3:09 AM > To: MINC users mailing list > Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > >> Okay, I tried that, but I still get this message: >> >> >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' >> /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' >> collect2: ld returned 1 exit status > > ah, ppm_allocrow, did you link bicpl with ppm or netpbm? > > I am not sure which platform you are compiling this on but on some > architectures you have to link with: > > -lpgm -lpbm > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users -- Best regards, Vladimir S. FONOV ~ v.s.fonov ilmarin.info From MKeaser at umaryland.edu Thu Apr 7 11:49:00 2011 From: MKeaser at umaryland.edu (Keaser, Michael L) Date: Thu, 7 Apr 2011 11:49:00 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: <4D9DD5F0.3020002@gmail.com> References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu>, <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D8@UMBEXMBX2.campus.umaryland.edu>, <4D9DD5F0.3020002@gmail.com> Message-ID: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2DC@UMBEXMBX2.campus.umaryland.edu> Valdimir, Yes, libnetpbm.a is in my /usr/local/minc/lib/ directory. So, i take it that means I link with netpbm. If I try using "lpbm", I get a similar error message. /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' collect2: ld returned 1 exit status Michael ________________________________________ From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Vladimir S. FONOV [vladimir.fonov at gmail.com] Sent: Thursday, April 07, 2011 11:19 AM To: MINC users mailing list Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc Hello, netpbm version 10.35.74 is build as part of quarantine creation. There should be file libnetpbm.a in /usr/local/minc/lib Keaser, Michael L wrote: > Andrew, > > So are you saying substitute -lpgm -lpbm for the lppm? If so, when I did that, I received this message: > > /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' > collect2: ld returned 1 exit status > > > Michael > ________________________________________ > From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] > Sent: Thursday, April 07, 2011 3:09 AM > To: MINC users mailing list > Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > >> Okay, I tried that, but I still get this message: >> >> >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' >> /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' >> collect2: ld returned 1 exit status > > ah, ppm_allocrow, did you link bicpl with ppm or netpbm? > > I am not sure which platform you are compiling this on but on some > architectures you have to link with: > > -lpgm -lpbm > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users -- Best regards, Vladimir S. FONOV ~ v.s.fonov ilmarin.info _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From vladimir.fonov at gmail.com Thu Apr 7 11:59:43 2011 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Thu, 7 Apr 2011 11:59:43 -0400 Subject: [MINC-users] build almost everything minc Makefile and git repository for EZminc In-Reply-To: <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2DC@UMBEXMBX2.campus.umaryland.edu> References: <4D715D1D.1090404@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AB@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2AC@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2CE@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D2@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D3@UMBEXMBX2.campus.umaryland.edu> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2D8@UMBEXMBX2.campus.umaryland.edu> <4D9DD5F0.3020002@gmail.com> <00EF2C3B391AF84C8ED343F4469D4D56055F5BC2DC@UMBEXMBX2.campus.umaryland.edu> Message-ID: Hello, then you should link with netpbm! I.e -L/usr/local/minc/lib -lnetpbm . Probably you also have another version of pbm installed in the system and something somewhere got confused. On Thu, Apr 7, 2011 at 11:49 AM, Keaser, Michael L wrote: > Valdimir, > > > Yes, libnetpbm.a is in my /usr/local/minc/lib/ directory. So, i take it that means I link with netpbm. If I try using "lpbm", I get a similar error message. > > /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' > /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' > /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' > collect2: ld returned 1 exit status > > > Michael > ________________________________________ > From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Vladimir S. FONOV [vladimir.fonov at gmail.com] > Sent: Thursday, April 07, 2011 11:19 AM > To: MINC users mailing list > Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc > > Hello, > > netpbm version 10.35.74 is build ?as part of quarantine creation. There > should be file libnetpbm.a in /usr/local/minc/lib > > Keaser, Michael L wrote: >> Andrew, >> >> So are you saying substitute -lpgm -lpbm for the lppm? If so, when I did that, I received this message: >> >> /usr/local/minc/src/Display-1.5.0/slice_window/crop.c:165: warning: the use of `tmpnam' is dangerous, better use `mkstemp' >> /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `output_rgb_file': >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:95: undefined reference to `ppm_writeppminit' >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:116: undefined reference to `ppm_writeppmrow' >> /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:29: undefined reference to `ppm_readppminit' >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' >> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:44: undefined reference to `ppm_readppmrow' >> collect2: ld returned 1 exit status >> >> >> Michael >> ________________________________________ >> From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] >> Sent: Thursday, April 07, 2011 3:09 AM >> To: MINC users mailing list >> Subject: Re: [MINC-users] build almost everything minc Makefile and git repository for EZminc >> >>> Okay, I tried that, but I still get this message: >>> >>> >>> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:98: undefined reference to `ppm_allocrow' >>> /usr/local/minc/lib/libbicpl.a(rgb_io.o): In function `input_rgb_file': >>> /usr/local/minc/src/bicpl-1.4.6/Images/rgb_io_ppm.c:31: undefined reference to `ppm_allocrow' >>> collect2: ld returned 1 exit status >> >> ah, ppm_allocrow, did you link bicpl with ppm or netpbm? >> >> I am not sure which platform you are compiling this on but on some >> architectures you have to link with: >> >> ? ?-lpgm -lpbm >> >> >> a >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > -- > Best regards, > ?Vladimir S. FONOV ~ v.s.fonov ? ilmarin.info > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Best regards, ?Vladimir S. Fonov ~ vladimir fonov gmail com From lrisa87 at uw.edu Thu Apr 7 14:05:19 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Thu, 7 Apr 2011 11:05:19 -0700 Subject: [MINC-users] best_nonlin_reg.pl ? In-Reply-To: References: <201102250344.p1P3i5tq002657@cassio.bic.mni.mcgill.ca> <4D6D8AD8.5000707@gmail.com> Message-ID: Hello, I am using volgenmodel to create a model. I have installed Octave, but I am still getting the following error and can't figure out what is the issue: ...bestlinreg.xfm genmodel-work/07/avgxfm.xfm > Processing:........................miicv_attach: MINC package entry point > ncvarid: ncid -1: NetCDF: Not a valid ID Died at /usr/local/bic/bin/xfmavg line 310. > Died at /usr/local/bic/bin/volgenmodel line 656. I've tried using volgenmodel for two different fit.conf settings and get the same error at about the same time point in the course of running this script. This error appears some point after the "07" folder and some, if not all, of their contents are created in the working directory. What could be some possible causes? Am I missing some other required script? Thanks. Best, Lisa ______________________________ On Thu, Mar 3, 2011 at 11:08 AM, Lisa F. Akiyama wrote: > Hi Andrew, > > I did not have Octave installed. > Right now I am re-running volgenmodel after I installed Octave > and so far it seems like it is chugging along without any errors at all. > > Thanks for all the tips and suggestions! > > > Best, > Lisa > > > > > > On Thu, Mar 3, 2011 at 5:15 AM, Andrew Janke wrote: > >> Hi Lisa, >> >> >> Died at /usr/local/bic/bin/xfmavg line 310. >> >> Died at /usr/local/bic/bin/volgenmodel line 656. >> > >> > The output file that I specified the name of is no where to be found in >> the >> > workdir or the dir where I have stored my input files. >> >> I think the output is a big misleading in that I think the problem is >> in the transform averaging not in the fitting. Do you have octave >> installed? xfmavg uses this. >> >> perhaps if you add a -verbose argument things might become a bit more >> clear? volgenmodel is designed such that you can just re-run whatever >> you did last and it will pick up from where it left off. >> >> There is even a copy of the original command you used in the >> genmodel-work directory. >> >> >> a >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > > From a.janke at gmail.com Thu Apr 7 20:09:44 2011 From: a.janke at gmail.com (Andrew Janke) Date: Fri, 8 Apr 2011 10:09:44 +1000 Subject: [MINC-users] best_nonlin_reg.pl ? In-Reply-To: References: <201102250344.p1P3i5tq002657@cassio.bic.mni.mcgill.ca> <4D6D8AD8.5000707@gmail.com> Message-ID: Hi Lisa, > ...bestlinreg.xfm genmodel-work/07/avgxfm.xfm >> Processing:........................miicv_attach: MINC package entry point >> ncvarid: ncid -1: NetCDF: Not a valid ID > I've tried using volgenmodel for two different fit.conf settings and get the > same error at > about the same time point in the course of running this script. > This error appears some point after the "07" folder and some, if not all, of > their contents are created in the working directory. > > ?What could be some possible causes? Am I missing some other required > script? I have tried to make volgenmodel as resistant to steps failing as I can but it would seem that there is always one more thing that can go wrong.... My guess is that you have an incomplete xfm file in the 07 step folder and this is causing xfmavg to fail. You can usually hunt down the culprit by going into this folder and running minccomplete on all of the .mnc and .xfm files in there. ie: $ ls *.mnc *.xfm | xargs -I {} minccomplete -verbose {} If any of the files return a -1 instead of 0 something went amiss. The best approach at this stage is to just remove this file and re-run volgenmodel at which point it should pick up where it left off. a From lrisa87 at uw.edu Fri Apr 8 17:27:41 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Fri, 8 Apr 2011 14:27:41 -0700 Subject: [MINC-users] best_nonlin_reg.pl ? In-Reply-To: References: <201102250344.p1P3i5tq002657@cassio.bic.mni.mcgill.ca> <4D6D8AD8.5000707@gmail.com> Message-ID: Hi Andrew, Thanks for your reply. I checked both runs of volgenmodel I was performing on the same set of data but with different configurations - one stopped at creation of working directory folder 03, the other stopping at folder 07. In both cases, I also checked the contents of all the folders that were created prior to 03 and 07, respectively, too, using the minccomplete command. However, in all cases, I got only got "0"'s, no "-1"'s. (Please see the attached text file for a copy of the results I got when running minccomplete in the 03 folder) I've removed the 03/07 folder and re-ran volgenmodel, but I still get the same error... When I run volgenmodel with the same configurations but with a different set of subjects, it runs fine...It is puzzling... Best, Lisa ______________________________ Lisa F. Akiyama Research Study Assistant Institute for Learning & Brain Sciences (I-LABS) University of Washington Portage Bay Building, BOX 357988 Seattle, WA 98195-7988 U.S.A. E-mail: lrisa87 at uw.edu P Please consider the environment before printing this e-mail. On Thu, Apr 7, 2011 at 5:09 PM, Andrew Janke wrote: > Hi Lisa, > > > ...bestlinreg.xfm genmodel-work/07/avgxfm.xfm > >> Processing:........................miicv_attach: MINC package entry > point > >> ncvarid: ncid -1: NetCDF: Not a valid ID > > > I've tried using volgenmodel for two different fit.conf settings and get > the > > same error at > > about the same time point in the course of running this script. > > This error appears some point after the "07" folder and some, if not all, > of > > their contents are created in the working directory. > > > > What could be some possible causes? Am I missing some other required > > script? > > I have tried to make volgenmodel as resistant to steps failing as I > can but it would seem that there is always one more thing that can go > wrong.... My guess is that you have an incomplete xfm file in the 07 > step folder and this is causing xfmavg to fail. > > You can usually hunt down the culprit by going into this folder and > running minccomplete on all of the .mnc and .xfm files in there. > > ie: > > $ ls *.mnc *.xfm | xargs -I {} minccomplete -verbose {} > > If any of the files return a -1 instead of 0 something went amiss. The > best approach at this stage is to just remove this file and re-run > volgenmodel at which point it should pick up where it left off. > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -------------- next part -------------- Checking a MINC file (0000-15331_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0000-15331_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0001-15354_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0001-15354_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0002-15399_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0002-15399_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0003-15484_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0003-15484_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0004-15874_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0004-15874_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0005-15952_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0005-15952_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0006-16097_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_renorm_grid_0.mnc) 0 Checking a XFM file (0006-16097_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_renorm.xfm) 0 Checking a MINC file (0007-16306_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0007-16306_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0008-16342_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0008-16342_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0009-16356_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0009-16356_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0010-16387_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0010-16387_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0011-16406_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0011-16406_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0012-16437_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0012-16437_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0013-16438_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0013-16438_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0014-16483_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0014-16483_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0015-16516_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0015-16516_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0016-16537_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0016-16537_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0017-16541_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0017-16541_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0018-16549_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0018-16549_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0019-16570_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0019-16570_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0020-16591_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0020-16591_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0021-16596_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0021-16596_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0022-16605_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0022-16605_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0023-16615_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0023-16615_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0024-16647_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0024-16647_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0025-16702_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0025-16702_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0026-16706_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new_grid_0.mnc) 0 Checking a XFM file (0026-16706_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new.xfm) 0 Checking a MINC file (0027-16734_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new_grid_0.mnc) 0 Checking a XFM file (0027-16734_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new.xfm) 0 Checking a MINC file (0028-SEA0092_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0028-SEA0092_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0029-SEA0094_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0029-SEA0094_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0030-SEA0102_6mo_Sep2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0030-SEA0102_6mo_Sep2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0031-SEA0111_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0031-SEA0111_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0032-SEA0112_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0032-SEA0112_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0033-SEA0120_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0033-SEA0120_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0034-SEA0124_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0034-SEA0124_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0035-SEA0135_6mo_June2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0035-SEA0135_6mo_June2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0036-SEA0136_6mo_May2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0036-SEA0136_6mo_May2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0037-SEA0141_6mo_July2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0037-SEA0141_6mo_July2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0038-SEA0152_6mo_Dec2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0038-SEA0152_6mo_Dec2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0039-SEA0153_7mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0039-SEA0153_7mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0040-SEA0154_6mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0040-SEA0154_6mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0041-SEA0157_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0041-SEA0157_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (0042-SEA0158_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (0042-SEA0158_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (avgxfm_grid_0.mnc) 0 Checking a XFM file (avgxfm.xfm) 0 Checking a MINC file (fit-model-iso.fit-msk.mnc) 0 Checking a MINC file (fit-model-iso.mnc) 0 Checking a MINC file (fit-model-iso.msk_blur.mnc) 0 Checking a MINC file (fit-model-iso.msk.mnc) 0 Checking a MINC file (fit-model-iso.nrm.mnc) 0 Checking a MINC file (init-0000-15331_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0000-15331_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0001-15354_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0001-15354_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0002-15399_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0002-15399_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0003-15484_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0003-15484_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0004-15874_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0004-15874_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0005-15952_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0005-15952_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0006-16097_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_renorm_grid_0.mnc) 0 Checking a XFM file (init-0006-16097_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_renorm.xfm) 0 Checking a MINC file (init-0007-16306_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0007-16306_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0008-16342_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0008-16342_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0009-16356_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0009-16356_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0010-16387_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0010-16387_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0011-16406_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0011-16406_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0012-16437_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0012-16437_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0013-16438_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0013-16438_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0014-16483_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0014-16483_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0015-16516_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0015-16516_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0016-16537_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0016-16537_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0017-16541_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0017-16541_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0018-16549_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0018-16549_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0019-16570_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0019-16570_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0020-16591_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0020-16591_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0021-16596_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0021-16596_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0022-16605_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0022-16605_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0023-16615_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0023-16615_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0024-16647_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0024-16647_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0025-16702_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0025-16702_001_MNI152maskedout_RAS_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0026-16706_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new_grid_0.mnc) 0 Checking a XFM file (init-0026-16706_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new.xfm) 0 Checking a MINC file (init-0027-16734_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new_grid_0.mnc) 0 Checking a XFM file (init-0027-16734_001_MNI152maskedout_RAS_nu_mincnorm_bestlinreg_nihpd_new.xfm) 0 Checking a MINC file (init-0028-SEA0092_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0028-SEA0092_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0029-SEA0094_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0029-SEA0094_6mo_May2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0030-SEA0102_6mo_Sep2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0030-SEA0102_6mo_Sep2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0031-SEA0111_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0031-SEA0111_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0032-SEA0112_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0032-SEA0112_6mo_Dec2009_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0033-SEA0120_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0033-SEA0120_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0034-SEA0124_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0034-SEA0124_6mo_Mar2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0035-SEA0135_6mo_June2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0035-SEA0135_6mo_June2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0036-SEA0136_6mo_May2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0036-SEA0136_6mo_May2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0037-SEA0141_6mo_July2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0037-SEA0141_6mo_July2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0038-SEA0152_6mo_Dec2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0038-SEA0152_6mo_Dec2010_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0039-SEA0153_7mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0039-SEA0153_7mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0040-SEA0154_6mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0040-SEA0154_6mo_Dec2010_t1mpr_flipped_MNI152maskedout-mipav_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0041-SEA0157_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0041-SEA0157_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 Checking a MINC file (init-0042-SEA0158_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg_grid_0.mnc) 0 Checking a XFM file (init-0042-SEA0158_6mo_Jan2011_t1mpr_flipped-MNI152maskedout_nu_mincnorm-reg_nihpd_bestlinreg.xfm) 0 From lrisa87 at uw.edu Fri Apr 8 19:28:40 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Fri, 8 Apr 2011 16:28:40 -0700 Subject: [MINC-users] best_nonlin_reg.pl ? In-Reply-To: References: <201102250344.p1P3i5tq002657@cassio.bic.mni.mcgill.ca> <4D6D8AD8.5000707@gmail.com> Message-ID: Another question on making average models.... I've been creating several preliminary models using different configurations and methods. The MNI average brain models for both adults and pediatrics are all straight in every direction. However, I look at my resulting models, some of them are a tad tilted in one or more directions. Going back and checking closely the individuals' scans that were coregistered (linear 9 parameter registration) to a standard template, I find that a few of the coregistered images are slightly tilted. I suspect that this is why the resulting average model is slightly tilted as well. Is this a common issue faced when coregistering each individual to a standard template and creating a model? If so, what are some of the common ways of fixing them so that the resulting average model will be straight in every direction and still keeping the proper MNI space? Thank you. Best, Lisa On Fri, Apr 8, 2011 at 2:27 PM, Lisa F. Akiyama wrote: > Hi Andrew, > > Thanks for your reply. > > I checked both runs of volgenmodel I was performing on the same set of data > but with different configurations - one stopped at creation of working > directory folder 03, the other stopping at folder 07. > In both cases, I also checked the contents of all the folders that were > created prior to 03 and 07, respectively, too, using the minccomplete > command. > However, in all cases, I got only got "0"'s, no "-1"'s. (Please see the > attached text file for a copy of the results I got when running minccomplete > in the 03 folder) > I've removed the 03/07 folder and re-ran volgenmodel, but I still get the > same error... > When I run volgenmodel with the same configurations but with a different > set of subjects, it runs fine...It is puzzling... > > > Best, > Lisa > ______________________________ > Lisa F. Akiyama > Research Study Assistant > Institute for Learning & Brain Sciences (I-LABS) > University of Washington > Portage Bay Building, BOX 357988 > Seattle, WA 98195-7988 U.S.A. > E-mail: lrisa87 at uw.edu > > P Please consider the environment before printing this e-mail. > > > > On Thu, Apr 7, 2011 at 5:09 PM, Andrew Janke wrote: > >> Hi Lisa, >> >> > ...bestlinreg.xfm genmodel-work/07/avgxfm.xfm >> >> Processing:........................miicv_attach: MINC package entry >> point >> >> ncvarid: ncid -1: NetCDF: Not a valid ID >> >> > I've tried using volgenmodel for two different fit.conf settings and get >> the >> > same error at >> > about the same time point in the course of running this script. >> > This error appears some point after the "07" folder and some, if not >> all, of >> > their contents are created in the working directory. >> > >> > What could be some possible causes? Am I missing some other required >> > script? >> >> I have tried to make volgenmodel as resistant to steps failing as I >> can but it would seem that there is always one more thing that can go >> wrong.... My guess is that you have an incomplete xfm file in the 07 >> step folder and this is causing xfmavg to fail. >> >> You can usually hunt down the culprit by going into this folder and >> running minccomplete on all of the .mnc and .xfm files in there. >> >> ie: >> >> $ ls *.mnc *.xfm | xargs -I {} minccomplete -verbose {} >> >> If any of the files return a -1 instead of 0 something went amiss. The >> best approach at this stage is to just remove this file and re-run >> volgenmodel at which point it should pick up where it left off. >> >> >> a >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > > From a.janke at gmail.com Sun Apr 10 22:44:35 2011 From: a.janke at gmail.com (Andrew Janke) Date: Mon, 11 Apr 2011 12:44:35 +1000 Subject: [MINC-users] best_nonlin_reg.pl ? In-Reply-To: References: <201102250344.p1P3i5tq002657@cassio.bic.mni.mcgill.ca> <4D6D8AD8.5000707@gmail.com> Message-ID: On Sat, Apr 9, 2011 at 09:28, Lisa F. Akiyama wrote: > Another question on making average models.... > > I've been creating several preliminary models using different configurations > and methods. > The MNI average brain models for both adults and pediatrics are all straight > in every direction. > However, I look at my resulting models, some of them are a tad tilted in one > or more directions. Going back and checking closely the individuals' scans > that were coregistered (linear 9 parameter registration) to a standard > template, This depends on whether you making a symmetric or non-symmetric (default) model. If non-symmetric the resulting image will be in the average space of all your input images meaning there is a left/Right rotation bias when your subjects are being scanned. If you make a symmetric model (add -symmetric to volgenmodel) then this should not happen. > Is this a common issue faced when coregistering each individual to a > standard template and creating a model? Yes, you are not alone! > If so, what are some of the common > ways of fixing them so that the resulting average model will be straight in > every direction and still keeping > the proper MNI space? I have a quick and dirty tool called volalign that does a registration of an image to itself and then takes 1/2 the resulting translation and rotation results and applies it. It won't be perfect as you really should iterate this sort of approach but with one run it will make things a whole lot better. You can get it here: http://packages.bic.mni.mcgill.ca/scripts/volalign Use it like this: $ volalign rotated-model.mnc align.xfm aligned-model.mnc Both align.xfm and aligned-model.mnc are output files. As part of this you might also then like to align 0,0,0 about the centre of the volume (or sometimes before), to do this use volcentre: http://packages.bic.mni.mcgill.ca/scripts/volcentre (sorry Nth Americans, you're going to have to learn how to spell, the fact that we English stole the word from the French is irrelevant) Use it as such: $ volcentre -zero_dircos in.mnc out.mnc use -help for more options. Then when you use volalign you can use the -world option so that your resulting image is centered about the 0,0,0 world co-ordinate. -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Brisbane->Australia +61 (402) 700 883 From thomas.funck at mail.mcgill.ca Wed Apr 27 15:59:28 2011 From: thomas.funck at mail.mcgill.ca (Thomas Funck) Date: Wed, 27 Apr 2011 19:59:28 +0000 Subject: [MINC-users] dynamic memory allocation for hyperslabs Message-ID: <53F3FD0032C9CC4BA836E8F0FC289065DB90@EXMBX2010-2.campus.MCGILL.CA> Hi, I'm trying to dynamically allocate memory for a hyperslab, but this always seems to lead to a seg fault. I used hyper-test.c to try and figure out the problem. The normal hyper-test.c compiles and runs fine, so I changed "dtemp[CX][CY][CZ];" to "double ***dtemp;" and then allocate the necessary memory by doing: dtemp=malloc(CX * sizeof(double**)); for(i=0; i< CX; i++) { dtemp[i]=malloc(CY * sizeof(double*)); for(j=0; j < CY; j++) { dtemp[i][j]=malloc(CZ * sizeof(double) ); } } However this resulted in a seg fault on the line: if (fabs(r - dtemp[i][j][k]) > 1.0e-15) So even though "miget_real_value_hyperslab" returns 0 and says it gets the hyperslab correctly, there seems to be a problem dereferencing "dtemp" when the memory has been dynamically allocated. Is there something wrong with my C? Or does "miget_real_value_hyperslab" not work correctly for dynamically allocated memory? Many thanks for any help! Best, Thomas From eskild at gmail.com Wed Apr 27 16:24:52 2011 From: eskild at gmail.com (Simon Eskildsen) Date: Wed, 27 Apr 2011 16:24:52 -0400 Subject: [MINC-users] dynamic memory allocation for hyperslabs In-Reply-To: <53F3FD0032C9CC4BA836E8F0FC289065DB90@EXMBX2010-2.campus.MCGILL.CA> References: <53F3FD0032C9CC4BA836E8F0FC289065DB90@EXMBX2010-2.campus.MCGILL.CA> Message-ID: Hi Thomas, If you want to dynamically allocate a 3D array, I would recommend doing something like the code below to avoid multiple allocations in for loops. Not sure if it solves your problem though. Best, Simon dtemp = alloc_3d_double(CX, CY, CZ); ...given the function: double ***alloc_3d_double(int n1, int n2, int n3) { double ***iii, **ii, *i; int j; iii = (double ***) calloc(n1,sizeof(double **)); alloc_error_check(iii); ii = (double **) calloc(n1 * n2,sizeof(double *)); alloc_error_check(ii); iii[0] = ii; for (j = 1; j < n1; j++) { iii[j] = iii[j - 1] + n2; } i = (double *) calloc(n1 * n2 * n3,sizeof(double)); alloc_error_check(i); ii[0] = i; for (j = 1; j < n1 * n2; j++) { ii[j] = ii[j - 1] + n3; } return iii; } ...and the definition: #define alloc_error_check(p) { \ if ((p) == NULL) { \ fprintf(stderr, "ERROR! Allocation failure. Probably out of memory.\n"); \ exit(1); \ } \ } On Wed, Apr 27, 2011 at 3:59 PM, Thomas Funck wrote: > Hi, > > I'm trying to dynamically allocate memory for a hyperslab, but this always seems to lead to a seg fault. ?I used hyper-test.c to try and figure out the problem. The normal hyper-test.c compiles and runs fine, so I changed "dtemp[CX][CY][CZ];" to "double ***dtemp;" and then allocate the necessary memory by doing: > > ? ? ? ?dtemp=malloc(CX * sizeof(double**)); > ? ? ? ?for(i=0; i< CX; i++) > ? ? ? ?{ > ? ? ? ?dtemp[i]=malloc(CY * sizeof(double*)); > ? ? ? ? ? ? ? ?for(j=0; j < CY; j++) > ? ? ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ?dtemp[i][j]=malloc(CZ * sizeof(double) ); > ? ? ? ? ? ? ? ?} > ? ? ? ?} > > However this resulted in a seg fault on the line: > > if (fabs(r - dtemp[i][j][k]) > 1.0e-15) > > So even though "miget_real_value_hyperslab" returns 0 and says it gets the hyperslab correctly, there seems to be a problem dereferencing "dtemp" when the memory has been dynamically allocated. > > Is there something wrong with my C? Or does "miget_real_value_hyperslab" not work correctly for dynamically allocated memory? > > Many thanks for any help! > > Best, > > Thomas > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Wed Apr 27 19:11:26 2011 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 28 Apr 2011 09:11:26 +1000 Subject: [MINC-users] dynamic memory allocation for hyperslabs In-Reply-To: <53F3FD0032C9CC4BA836E8F0FC289065DB90@EXMBX2010-2.campus.MCGILL.CA> References: <53F3FD0032C9CC4BA836E8F0FC289065DB90@EXMBX2010-2.campus.MCGILL.CA> Message-ID: Hi Thomas, On Thu, Apr 28, 2011 at 05:59, Thomas Funck wrote: > I'm trying to dynamically allocate memory for a hyperslab, but this always seems to lead to a seg fault. ?I used hyper-test.c to try and figure out the problem. The normal hyper-test.c compiles and runs fine, so I changed "dtemp[CX][CY][CZ];" to "double ***dtemp;" and then allocate the necessary memory by doing: > > ? ? ? ?dtemp=malloc(CX * sizeof(double**)); > ? ? ? ?for(i=0; i< CX; i++) > ? ? ? ?{ > ? ? ? ?dtemp[i]=malloc(CY * sizeof(double*)); > ? ? ? ? ? ? ? ?for(j=0; j < CY; j++) > ? ? ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ?dtemp[i][j]=malloc(CZ * sizeof(double) ); > ? ? ? ? ? ? ? ?} > ? ? ? ?} > > However this resulted in a seg fault on the line: > > if (fabs(r - dtemp[i][j][k]) > 1.0e-15) > > So even though "miget_real_value_hyperslab" returns 0 and says it gets the hyperslab correctly, there seems to be a problem dereferencing "dtemp" when the memory has been dynamically allocated. > > Is there something wrong with my C? Or does "miget_real_value_hyperslab" not work correctly for dynamically allocated memory? miget_real_value_hyperslab does work for dynamically allocated memory, but I dont think you are doing what you want to be... miget_real_value_hyperslab is expecting a pointer to a memory buffer that will be then indexed as per a "normal" multidimensional array. see: http://pw1.netcom.com/~tjensen/ptr/ch7x.htm or http://en.wikibooks.org/wiki/C_Programming/Arrays for an explanation of how in C array[x][y] is really just *(*(array + x) + y) What you are allocating is an array of pointers to arrays pointers to arrays. (Here's hoping I got my grammar right there!). If you want to dynamically allocate the array you can either do a single malloc buf = malloc(sizeof(double) * CX * CY * CZ) or take advantage of being able to declare arrays within blocks: int somefunction(int CX, int CY, int CZ){ array[CX][CY][CZ]; ... } The reason your array of pointers to arrays or pointers to arrays doesn't work as you'd expect is that miget_real_value_hyperslab will be attempting to stuff the entire hyperslabs values into the first array of pointers (ie: in dtemp), which is nothing more than array of double* of length CX. Odds are this will work at runtime as C doesn't do much bounds checking and odds are the memory you are allocating for the sub-arrays will be right after dtemp so things will probably work 90% of the time. When you go to access the elements though things may well break. Hope that helps, I could be wrong with the above but this is what I can guess from the code and info you have sent so far. ta -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Brisbane->Australia +61 (402) 700 883