frankkramer-lab / MIScnn

A framework for Medical Image Segmentation with Convolutional Neural Networks and Deep Learning
GNU General Public License v3.0
402 stars 116 forks source link

slice 3D matrix uses wrong axis #46

Closed MLRadfys closed 3 years ago

MLRadfys commented 3 years ago

Hi Dominik,

hope you're doing well. Iam just wondering if the slice function for 3D volume uses the correct axis?

As far as I can see you are using the following axis order --> (z,x,y,c) It seems though that the 3D slice function uses a (x,y,z,c) order?

steps_x = int(math.ceil((len(array) - overlap[0]) / float(window[0] - overlap[0]))) steps_y = int(math.ceil((len(array[0]) - overlap[1]) / float(window[1] - overlap[1]))) steps_z = int(math.ceil((len(array[0][0]) - overlap[2]) / float(window[2] - overlap[2])))

Cheers,

Michael

muellerdo commented 3 years ago

Hey Michael,

In the MIScnn code, normally an encoding of (x,y,z,c) is used. But the order of x,y,z is independent in the context of: It shouldn't matter as long as your provided parameters like patch size etc or pixel spacings are in the same axis order as your data.

The only exception to this is the NIfTI Slicer IO Interface, which can only slice on the first (0) axis. This inconsistency is a little bit odd. Therefore, I added a parameter to the NIfTI Slicer IO (slice_axis=0) which can be altered in order to specify on which axis the volume should be sliced. Normally, it should be either the first or third axis depending on your imaging data.

Cheers, Dominik

Tasks

Related Commits: 08d7a5d235d2aae5bc34a271a36eca024d889c25 b42b4a70b50889f222d885b1138c292411f79fd4