Skip to content

Commit

Permalink
Exchange for loops
Browse files Browse the repository at this point in the history
This should help the compiler understand what to do now.
  • Loading branch information
malaterre committed Nov 15, 2022
1 parent 9030ae0 commit 33a0060
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/MediaStorageAndFileFormat/gdcmSplitMosaicFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ namespace details {
static bool reorganize_mosaic(const unsigned short *input, const unsigned int *inputdims,
unsigned int square, const unsigned int *outputdims, unsigned short *output )
{
for(unsigned int x = 0; x < outputdims[0]; ++x)
for(unsigned int z = 0; z < outputdims[2]; ++z)
{
for(unsigned int y = 0; y < outputdims[1]; ++y)
{
for(unsigned int z = 0; z < outputdims[2]; ++z)
for(unsigned int x = 0; x < outputdims[0]; ++x)
{
const size_t outputidx = x + y*outputdims[0] + z*outputdims[0]*outputdims[1];
const size_t inputidx = (x + (z%square)*outputdims[0]) +
Expand All @@ -50,11 +50,11 @@ static bool reorganize_mosaic(const unsigned short *input, const unsigned int *i
static bool reorganize_mosaic_invert(const unsigned short *input, const unsigned int *inputdims,
unsigned int square, const unsigned int *outputdims, unsigned short *output )
{
for(unsigned int x = 0; x < outputdims[0]; ++x)
for(unsigned int z = 0; z < outputdims[2]; ++z)
{
for(unsigned int y = 0; y < outputdims[1]; ++y)
{
for(unsigned int z = 0; z < outputdims[2]; ++z)
for(unsigned int x = 0; x < outputdims[0]; ++x)
{
const size_t outputidx = x + y*outputdims[0] + (outputdims[2]-1-z)*outputdims[0]*outputdims[1];
const size_t inputidx = (x + (z%square)*outputdims[0]) +
Expand Down

0 comments on commit 33a0060

Please sign in to comment.