brainvisa / aims-free

Analysis of Images and Signal for neuroimaging
Other
6 stars 3 forks source link

4D (or more) volumes are not read correctly anymore #51

Closed nsouedet closed 3 years ago

nsouedet commented 3 years ago

Following commands does not seem to work correctly anymore :

'AimsVolumeExtract' '-o' '/tmp/test.ima' '-t' 'FLOAT' '-od' '512' '512' '1' '56' '-ov' '0.000219880603254' '0.000219880603254' '1' '1'

AimsFileInfo -i /tmp/test.ima -v

A segmentation fault occurs when trying to read the writen /tmp/test.ima file :

!instantiation! N5carto6rc_ptrINS_18NiftiStructWrapperEEE mutable 0x7fb398dc06e0 rc_ptr of N5carto18NiftiStructWrapperE
!instantiation! P7QWidget mutable 0x7fb38c1057c8 P7QWidget
!instantiation! P7_object mutable 0x7fb38692ead3 PyObject
!instantiation! N5carto18interface_internal12IterableImplIP7_objectLb0EE17PyMappingIteratorE mutable 0x7fb38692ead2 N5carto18interface_internal12IterableImplIP7_objectLb0EE17PyMappingIteratorE
!instantiation! N5carto18interface_internal12IterableImplIP7_objectLb0EE16PyObjectIteratorE mutable 0x7fb38692ead1 N5carto18interface_internal12IterableImplIP7_objectLb0EE16PyObjectIteratorE
!instantiation! St6vectorIN5carto6rc_ptrI15AimsTimeSurfaceILi3E4VoidEEESaIS5_EE mutable 0x7fb38692ead0 vector of rc_ptr of Mesh of VOID
attributes = {
    'volume_dimension' : [ 512, 512, 1, 56 ],
    'sizeX' : 512,
    'sizeY' : 512,
    'sizeZ' : 1,
    'sizeT' : 56,
    'voxel_size' : [ 0.000219880603253841, 0.000219880603253841, 1, 1 ],
    'object_type' : 'Volume',
    'data_type' : 'FLOAT',
    'ascii' : 0,
    'byte_swapping' : 0,
    'file_type' : 'GIS'
  }
readBlock( failed at ( 0,129,0,1) : 508 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
*** Error in `AimsFileInfo': double free or corruption (out): 0x00000000028c11a0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777f5)[0x7fb3a1cf67f5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8038a)[0x7fb3a1cff38a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fb3a1d0358c]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libcartodata.so.5.1.0(_ZN5carto6VolumeIfED1Ev+0xd2)[0x7fb3a5862682]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libcartodata.so.5.1.0(_ZN5carto6VolumeIfED0Ev+0x9)[0x7fb3a58626f9]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libcartodata.so.5.1.0(_ZN5carto12FormatReaderINS_6VolumeIfEEE13createAndReadENS_6rc_ptrINS_14DataSourceInfoEEERKNS_16AllocatorContextENS_6ObjectE+0x635)[0x7fb3a51c8985]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libcartodata.so.5.1.0(_ZN5carto18VolumeFormatReaderIfE13createAndReadENS_6rc_ptrINS_14DataSourceInfoEEERKNS_16AllocatorContextENS_6ObjectE+0x6cb)[0x7fb3a53327fb]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libcartodata.so.5.1.0(_ZN5carto6ReaderINS_6VolumeIfEEE4readENS_6ObjectEii+0x1838)[0x7fb3a53ada38]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims20SomaIOAimsDataFormatIfE4readERKSsR8AimsDataIfERKN5carto16AllocatorContextENS7_6ObjectE+0x23b)[0x7fb3a6e15b2b]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims6ReaderI8AimsDataIfEE4readERS2_iPKSsi+0x2105)[0x7fb3a7365965]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims12VolumeFormatIfE4readERKSsRKN5carto16AllocatorContextENS4_6ObjectE+0x35b)[0x7fb3a6de836b]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims15VolumeRefFormatIfE4readERKSsRKN5carto16AllocatorContextENS4_6ObjectE+0x71)[0x7fb3a6de8801]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims6ReaderIN5carto9VolumeRefIfEEE4readEiPKSsi+0x26ff)[0x7fb3a70df1af]
AimsFileInfo(_Z12printExtremaIfEbRN5carto9VolumeRefIT_EERKSsRKN4aims6FinderEb+0xfb)[0x411bab]
AimsFileInfo[0x40cf7d]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims7Process7executeERNS_6FinderERKSs+0x2d4)[0x7fb3a6e75224]
/volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/lib/libaimsdata.so.5.1.0(_ZN4aims7Process7executeERKSs+0x46)[0x7fb3a6e75b16]
AimsFileInfo(main+0x234)[0x409dc4]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fb3a1c9f840]
AimsFileInfo(_start+0x29)[0x40a169]
======= Memory map: ========
00400000-0041d000 r-xp 00000000 fc:01 41955480                           /volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/bin/AimsFileInfo
0061c000-0061d000 r--p 0001c000 fc:01 41955480                           /volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/bin/AimsFileInfo
0061d000-0061e000 rw-p 0001d000 fc:01 41955480                           /volatile/ns215310/development/svn/brainvisa_bioproj/brainvisa/build/Ubuntu-16.04-x86_64/trunk/release/bin/AimsFileInfo
01cae000-029e2000 rw-p 00000000 00:00 0                                  [heap]
7fb2d8000000-7fb2d8021000 rw-p 00000000 00:00 0 
7fb2d8021000-7fb2dc000000 ---p 00000000 00:00 0 
7fb2de13e000-7fb2de17e000 rw-p 00000000 00:00 0 
7fb2de17e000-7fb2de183000 r-xp 00000000 fc:00 314928                     /usr/lib/python2.7/lib-dynload/mmap.x86_64-linux-gnu.so
7fb2de183000-7fb2de382000 ---p 00005000 fc:00 314928                     /usr/lib/python2.7/lib-dynload/mmap.x86_64-linux-gnu.so
7fb2de382000-7fb2de383000 r--p 00004000 fc:00 314928                     /usr/lib/python2.7/lib-dynload/mmap.x86_64-linux-gnu.so
7fb2de383000-7fb2de384000 rw-p 00005000 fc:00 314928                     /usr/lib/python2.7/lib-dynload/mmap.x86_64-linux-gnu.so
7fb2de384000-7fb2de3c4000 rw-p 00000000 00:00 0 
7fb2de3c4000-7fb2de3df000 r-xp 00000000 00:32 2088008935                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/streams.so
7fb2de3df000-7fb2de5de000 ---p 0001b000 00:32 2088008935                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/streams.so
7fb2de5de000-7fb2de5e1000 rw-p 0001a000 00:32 2088008935                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/streams.so
7fb2de5e1000-7fb2de612000 r-xp 00000000 00:32 2088008929                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/mio5_utils.so
7fb2de612000-7fb2de811000 ---p 00031000 00:32 2088008929                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/mio5_utils.so
7fb2de811000-7fb2de815000 rw-p 00030000 00:32 2088008929                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/mio5_utils.so
7fb2de815000-7fb2de816000 rw-p 00000000 00:00 0 
7fb2de816000-7fb2de81e000 r-xp 00000000 00:32 2088008930                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/mio_utils.so
7fb2de81e000-7fb2dea1e000 ---p 00008000 00:32 2088008930                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/mio_utils.so
7fb2dea1e000-7fb2dea1f000 rw-p 00008000 00:32 2088008930                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/io/matlab/mio_utils.so
7fb2dea1f000-7fb2dea7d000 r-xp 00000000 fc:00 1204059                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7fb2dea7d000-7fb2dec7d000 ---p 0005e000 fc:00 1204059                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7fb2dec7d000-7fb2dec81000 r--p 0005e000 fc:00 1204059                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7fb2dec81000-7fb2dec87000 rw-p 00062000 fc:00 1204059                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7fb2dec93000-7fb2decd3000 rw-p 00000000 00:00 0 
7fb2decd3000-7fb2dece8000 r-xp 00000000 fc:00 314900                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fb2dece8000-7fb2deee7000 ---p 00015000 fc:00 314900                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fb2deee7000-7fb2deee8000 r--p 00014000 fc:00 314900                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fb2deee8000-7fb2deeec000 rw-p 00015000 fc:00 314900                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fb2deeec000-7fb2def6c000 rw-p 00000000 00:00 0 
7fb2def6c000-7fb2defb4000 r-xp 00000000 fc:00 791934                     /usr/lib/python2.7/dist-packages/PIL/_imaging.x86_64-linux-gnu.so
7fb2defb4000-7fb2df1b4000 ---p 00048000 fc:00 791934                     /usr/lib/python2.7/dist-packages/PIL/_imaging.x86_64-linux-gnu.so
7fb2df1b4000-7fb2df1b7000 r--p 00048000 fc:00 791934                     /usr/lib/python2.7/dist-packages/PIL/_imaging.x86_64-linux-gnu.so
7fb2df1b7000-7fb2df1ba000 rw-p 0004b000 fc:00 791934                     /usr/lib/python2.7/dist-packages/PIL/_imaging.x86_64-linux-gnu.so
7fb2df1ba000-7fb2df23a000 rw-p 00000000 00:00 0 
7fb2df23a000-7fb2df266000 r-xp 00000000 00:32 2090968706                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_hausdorff.so
7fb2df266000-7fb2df466000 ---p 0002c000 00:32 2090968706                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_hausdorff.so
7fb2df466000-7fb2df469000 rw-p 0002c000 00:32 2090968706                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_hausdorff.so
7fb2df469000-7fb2df46a000 rw-p 00000000 00:00 0 
7fb2df46a000-7fb2df47f000 r-xp 00000000 00:32 2090968705                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_distance_wrap.so
7fb2df47f000-7fb2df67f000 ---p 00015000 00:32 2090968705                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_distance_wrap.so
7fb2df67f000-7fb2df680000 rw-p 00015000 00:32 2090968705                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_distance_wrap.so
7fb2df680000-7fb2df6ac000 r-xp 00000000 00:32 2090968713                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_voronoi.so
7fb2df6ac000-7fb2df8ab000 ---p 0002c000 00:32 2090968713                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_voronoi.so
7fb2df8ab000-7fb2df8af000 rw-p 0002b000 00:32 2090968713                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/_voronoi.so
7fb2df8af000-7fb2df8b8000 r-xp 00000000 00:32 2081960971                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/_lib/messagestream.so
7fb2df8b8000-7fb2dfab8000 ---p 00009000 00:32 2081960971                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/_lib/messagestream.so
7fb2dfab8000-7fb2dfab9000 rw-p 00009000 00:32 2081960971                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/_lib/messagestream.so
7fb2dfab9000-7fb2dfb8c000 r-xp 00000000 00:32 2090968719                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/qhull.so
7fb2dfb8c000-7fb2dfd8c000 ---p 000d3000 00:32 2090968719                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/qhull.so
7fb2dfd8c000-7fb2dfd95000 rw-p 000d3000 00:32 2090968719                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/qhull.so
7fb2dfd95000-7fb2dfd97000 rw-p 00000000 00:00 0 
7fb2dfd97000-7fb2dfd9d000 rw-p 003a6000 00:32 2090968719                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/qhull.so
7fb2dfd9d000-7fb2dfda3000 r-xp 00000000 fc:00 314908                     /usr/lib/python2.7/lib-dynload/_multiprocessing.x86_64-linux-gnu.so
7fb2dfda3000-7fb2dffa2000 ---p 00006000 fc:00 314908                     /usr/lib/python2.7/lib-dynload/_multiprocessing.x86_64-linux-gnu.so
7fb2dffa2000-7fb2dffa3000 r--p 00005000 fc:00 314908                     /usr/lib/python2.7/lib-dynload/_multiprocessing.x86_64-linux-gnu.so
7fb2dffa3000-7fb2dffa4000 rw-p 00006000 fc:00 314908                     /usr/lib/python2.7/lib-dynload/_multiprocessing.x86_64-linux-gnu.so
7fb2dffa4000-7fb2dffe4000 rw-p 00000000 00:00 0 
7fb2dffe4000-7fb2e007c000 r-xp 00000000 00:32 2090968714                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/ckdtree.so
7fb2e007c000-7fb2e027b000 ---p 00098000 00:32 2090968714                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/ckdtree.so
7fb2e027b000-7fb2e0283000 rw-p 00097000 00:32 2090968714                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/spatial/ckdtree.so
7fb2e0283000-7fb2e0284000 rw-p 00000000 00:00 0 
7fb2e0284000-7fb2e02cf000 r-xp 00000000 00:32 2106724352                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_reordering.so
7fb2e02cf000-7fb2e04cf000 ---p 0004b000 00:32 2106724352                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_reordering.so
7fb2e04cf000-7fb2e04d4000 rw-p 0004b000 00:32 2106724352                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_reordering.so
7fb2e04d4000-7fb2e04d5000 rw-p 00000000 00:00 0 
7fb2e04d5000-7fb2e0503000 r-xp 00000000 00:32 2106724351                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_min_spanning_tree.so
7fb2e0503000-7fb2e0702000 ---p 0002e000 00:32 2106724351                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_min_spanning_tree.so
7fb2e0702000-7fb2e0706000 rw-p 0002d000 00:32 2106724351                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_min_spanning_tree.so
7fb2e0706000-7fb2e0707000 rw-p 00000000 00:00 0 
7fb2e0707000-7fb2e0727000 r-xp 00000000 00:32 2106724355                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_traversal.so
7fb2e0727000-7fb2e0927000 ---p 00020000 00:32 2106724355                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_traversal.so
7fb2e0927000-7fb2e092b000 rw-p 00020000 00:32 2106724355                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_traversal.so
7fb2e092b000-7fb2e094d000 r-xp 00000000 00:32 2106724354                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_tools.so
7fb2e094d000-7fb2e0b4d000 ---p 00022000 00:32 2106724354                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_tools.so
7fb2e0b4d000-7fb2e0b51000 rw-p 00022000 00:32 2106724354                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_tools.so
7fb2e0b51000-7fb2e0b88000 r-xp 00000000 00:32 2106724353                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_shortest_path.so
7fb2e0b88000-7fb2e0d87000 ---p 00037000 00:32 2106724353                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_shortest_path.so
7fb2e0d87000-7fb2e0d8e000 rw-p 00036000 00:32 2106724353                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/csgraph/_shortest_path.so
7fb2e0d8e000-7fb2e0dce000 rw-p 00000000 00:00 0 
7fb2e0dce000-7fb2e0e36000 r-xp 00000000 00:32 2103571172                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/_csparsetools.so
7fb2e0e36000-7fb2e1036000 ---p 00068000 00:32 2103571172                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/_csparsetools.so
7fb2e1036000-7fb2e103c000 rw-p 00068000 00:32 2103571172                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/_csparsetools.so
7fb2e103c000-7fb2e107d000 rw-p 00000000 00:00 0 
7fb2e107d000-7fb2e13b8000 r-xp 00000000 00:32 2103571175                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/_sparsetools.so
7fb2e13b8000-7fb2e15b8000 ---p 0033b000 00:32 2103571175                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/_sparsetools.so
7fb2e15b8000-7fb2e15b9000 rw-p 0033b000 00:32 2103571175                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/sparse/_sparsetools.so
7fb2e15b9000-7fb2e160a000 r-xp 00000000 00:32 2082058089                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/interpnd.so
7fb2e160a000-7fb2e1809000 ---p 00051000 00:32 2082058089                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/interpnd.so
7fb2e1809000-7fb2e180e000 rw-p 00050000 00:32 2082058089                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/interpnd.so
7fb2e180e000-7fb2e180f000 rw-p 00000000 00:00 0 
7fb2e180f000-7fb2e185d000 r-xp 00000000 00:32 2082058083                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_ppoly.so
7fb2e185d000-7fb2e1a5d000 ---p 0004e000 00:32 2082058083                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_ppoly.so
7fb2e1a5d000-7fb2e1a63000 rw-p 0004e000 00:32 2082058083                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_ppoly.so
7fb2e1a63000-7fb2e1a64000 rw-p 00000000 00:00 0 
7fb2e1a64000-7fb2e1a68000 rw-p 0017c000 00:32 2082058083                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_ppoly.so
7fb2e1a68000-7fb2e1aa8000 rw-p 00000000 00:00 0 
7fb2e1aa8000-7fb2e1ae6000 r-xp 00000000 00:32 2105503975                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_bspl.so
7fb2e1ae6000-7fb2e1ce5000 ---p 0003e000 00:32 2105503975                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_bspl.so
7fb2e1ce5000-7fb2e1ceb000 rw-p 0003d000 00:32 2105503975                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_bspl.so
7fb2e1ceb000-7fb2e1cec000 rw-p 00000000 00:00 0 
7fb2e1cec000-7fb2e1cef000 rw-p 00134000 00:32 2105503975                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/_bspl.so
7fb2e1cef000-7fb2e1d4e000 r-xp 00000000 00:32 2082058084                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/dfitpack.so
7fb2e1d4e000-7fb2e1f4e000 ---p 0005f000 00:32 2082058084                 /i2bm/brainvisa/Ubuntu-16.04-x86_64/python2.7-pip/lib/python2.7/site-packages/scipy/interpolate/dfitpack.soAbandon (core dumped)
denisri commented 3 years ago

Could you write a test program/script for this command and use case so that we know in the future when it works and when it breaks ? It will be useful to debug this issue too ;)

nsouedet commented 3 years ago

Hello Denis, Yes, I am going to do a use case and a script. My first tests let me think that writer is OK, but reader seems to be buggy (may be related to strides extended support). Are you able to reproduce the issue on your side ?

denisri commented 3 years ago

AimsVolumeExtract did produce a file with the correct size, so I guess the problem is in memory allocation for 4D (or more) volumes. Probably in the recent changes I did, so I guess it's my fault. I'm trying with 5.0 also...

nsouedet commented 3 years ago

For me 5.0 is OK

denisri commented 3 years ago

That's it: brainvisa 5.0 reads the file correctly, so the bug is in new modifs in master, and not in AimsVolumeExtract. I'll check that.

nsouedet commented 3 years ago

Yes doing a read from 5.0 of a file writen with master version is also OK, that's why I said that the issue is related to master reader changes.

nsouedet commented 3 years ago

Thanks a lot

nsouedet commented 3 years ago

You are right, the issue is more general and is not related to unallocated date. It is related to 4D (or more) data.

The 3D case is OK

from soma import aims

# 3D data
v = aims.Volume_FLOAT(512,256,1) 
aims.write(v, '/tmp/test_3d.ima') # Write is OK
v = aims.read('/tmp/test_3d.ima') # Read is OK
print('3D test is ok')

Whereas the 4D case fails

# 4D data
v = aims.Volume_FLOAT(512,256,1, 2) 
aims.write(v, '/tmp/test_4d.ima') # Write is OK
v = aims.read('/tmp/test_4d.ima') # Read fails
print('4D test is ok')

In the 4D case, at reading, the following messages are displayed (8 times the same message):

readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
readBlock( failed at ( 0,65,0,1) : 408 != 512
denisri commented 3 years ago

it's in the allocate() method, there is a bug in the calculation of the volume size with/without strides. I'm fixing that.

nsouedet commented 3 years ago

Fine, thanks a lot !