load_projections() function crash
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 249
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to load a sequence of TIFF files (each file has the size 2400x2802) from a directory, but the function crashes because the number of columns is wrong. The code I am using to load the files is:
-----
....
# setup data structure for projection with geometry info
leapct.set_conebeam(numAngles, numRows, numCols, pixelSize, pixelSize, offv, offu, rotAngles, sad, sdd,0,0,eta)
g = leapct.allocate_projections() # shape is numAngles, numRows, numCols
# Now load the data
g[:] = 0.0
input_dir = "D:\\Microfuoco\\27Agosto2026\\tooth_rec_in\\"
g = leapct.load_projections(os.path.join(input_dir, 'tooth_rec_in.tif'))
......
-----
The program crashes with the following error message:
-----------------------------------------------------------------------------------------------------------------------------
warning: fread in read_tif_32f may have failed (firstRow=0, lastRow=2399, numCols=26899200, offset_to_data=8)
Traceback (most recent call last):
File "C:\Users\gdido\DeepLearning\leap_gdido\code\leap_fdk_recon.py", line 98, in
g = leapct.load_projections(os.path.join(input_dir, 'canino_bottom_rec_in.tif'))
File "C:\Users\gdido\miniforge3\envs\pytorch\Lib\site-packages\leapctype.py", line 7041, in load_projections
return self.load_data(fileName, x, fileRange, rowRange, colRange, axis_split)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\gdido\miniforge3\envs\pytorch\Lib\site-packages\leapctype.py", line 7199, in load_data
if self.load_tif(curFile, anImage, rowRange, colRange) is None:
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\gdido\miniforge3\envs\pytorch\Lib\site-packages\leapctype.py", line 6867, in load_tif
if self.libprojectors.read_tif(path, x):
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
OSError: exception: access violation reading 0x000002E40380D000
-------------------------------------------------------------------------------------------------------------------------------
It seems that a wrong number of columns are read from the file. I have tried to set the column range (colRange=[0,2801]), but it doesn't work.
Please, do you give me any suggestion to solve the problem?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the load_projections, load_data, and load_tif entry points shown in leapctype.py, then inspect how read_tif_32f determines numCols from the TIFF input. Reproduce the failure with the stated 2400x2802 files and verify that loading completes without the access violation and uses the expected dimensions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100