pnlbwh / ukftractography

Other
25 stars 27 forks source link

Error while resizing data #123

Closed tashrifbillah closed 4 years ago

tashrifbillah commented 5 years ago

Hi @rmukh , on top of your head, can you tell where the bound [0,10] is coming from? In other words, is there a way to solve the error?

'/home/tb571/Downloads/pnlpipe/soft_light/UKFTractography-662c16f/UKFTractography', '--dwiFile', '/tmp/tmpfskfgk4c/dwi.nhdr', '--maskFile', '/tmp/tmpfskfgk4c/dwimask.nhdr', '--seedsFile', '/tmp/tmpfskfgk4c/dwimask.nhdr', '--tracts', '/tmp/dwi_pipeline_1/derivatives/tmp/sub-003_GNX_007_dwi.vtk', '--numTensor', '2', '--stoppingFA', '0.15', '--seedingThreshold', '0.18', '--Qm', '0.001', '--Ql', '70', '--Rs', '0.015', '--stepLength', '0.3', '--recordLength', '1.7', '--stoppingThreshold', '0.1', '--seedsPerVoxel', '10', '--recordTensors']

Using the 2T simple model. Setting the default parameters accordingly:
"*": set by user
"-": default setting
- stoppingFA: 0.15
* seedingThreshold: 0.18
* Qm: 0.001
* Ql: 70
* Rs: 0.015
* stepLength: 0.3
* recordLength: 1.7
* stoppingThreshold: 0.1
* seedsPerVoxel: 10
Found 32 cores on your system.
Running tractography with 32 thread(s).
Number of non-zero gradients: 40
Number of zero gradients: 4
Permuting the axis order to: 3 0 1 2
Resizing the data to: 40 64 64 36

Error:

Error while resizing the data!
[nrrd] nrrdCrop: axis 0 min (0) or max (39) out of bounds [0,10]
rmukh commented 5 years ago

Hi @tashrifbillah. I guess it comes from the file nrrdCrop(temp, normalized, &newSize_Min[0], &newSize_Max[0]) in dwi_normalize.cc

The input variable - normalized -I guess the reason for that error. To be more specifically it comes from normalized ->axis[ai].size property where ai is checked in the loop for (ai=0; ai<normalized ->dim; ai++). Since it goes through a lot of processing before it comes to the crop function I guess there is no quick solution. The one thing worth trying is to replace nrrdCrop to nrrdSimpleCrop(temp, normalized,&newSize_Min[0]) or nrrdSimpleCrop(temp, normalized,&newSize_Max[0])

Another option to try is to resize (permute axis) the input dMRI image in Slicer and then run it with an already resized image.

I will take a closer look in free time. Please, let me know if one of those methods works.

tashrifbillah commented 4 years ago

Closing due to inactivity.