def run(self,inputVolume,outputVolume,labelmaps_filename):
    # get the shape     
    input_image = inputVolume.GetImageData()
    shape = list(input_image.GetDimensions())
    shape.reverse()
    input_array = vtk.util.numpy_support.vtk_to_numpy(input_image.GetPointData().GetScalars()).reshape(shape)
    
    outputVolume_temp = np.ones(shape)
    print("input volume shape")
    print(np.shape(input_array))
    #self.delayDisplay('Running the aglorithm '+str(shape))

    #outputArray = slicer.util.array(outputVolume.GetID())
    
    #call a function that takes as input the volume and a list of labelmaps
    my_pectoralis_segmentor = pectoralis_segmentor.pectoralis_segmentor(input_array, labelmaps_filename)
    outputVolume_temp = my_pectoralis_segmentor.execute()

    #outputVolume_temp2 = np.asarray(outputVolume_temp).swapaxes(0, 0)
    #outputVolume_temp2 = outputVolume_temp[::-1,...]
    #outputVolume_temp2 = outputVolume_temp.swapaxes(0, 0)
        
    outputVolume_temp2 = self.rev(outputVolume_temp, 0)
    print("out volume shape")
    print(np.shape(outputVolume_temp2))
    outputVolume_temp2 = outputVolume_temp
    shape = list(input_image.GetDimensions())
    
    volumesLogic = slicer.modules.volumes.logic()
    outputVolume = volumesLogic.CloneVolume(slicer.mrmlScene, inputVolume, 'Volume_Out')
    outputArray = slicer.util.array(outputVolume.GetID())
    print(np.shape(outputArray))
    outputArray[:]  = outputVolume_temp2.squeeze().reshape()
    outputVolume.GetImageData().Modified()
    #print(outputVolume) #vtkMRMLScalarVolumeNode
    #outputVolume.SetDimensions(shape)
    outputVolume.Modified()
    
    #set the vtk volume information

    print("output_shape")
    print(np.shape(outputVolume_temp))
    print(np.amax(outputVolume_temp))
    print(shape)
    #create a vtk volume to return
    #dataImporter = vtk.vtkImageImport()
    #dataImporter.CopyImportVoidPointer(outputVolume_temp,outputVolume_temp.nbytes)
    #dataImporter.SetDataScalarTypeToInt()
    #dataImporter.SetNumberOfScalarComponents(1)
    #dataImporter.SetDataExtent(0,shape[0], 0, shape[1], 0, shape[2])
    #dataImporter.SetWholeExtent(0,shape[0], 0, shape[1], 0, shape[2])
    
    
    #outputVolume.SetImageDataConnection() = inputVolume.GetImageDataConnection()
    
    return True
Run the actual algorithm
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PectoralisSegmentation/PectoralisSegmentation.py/PectoralisSegmentationLogic.run