@staticmethod 
    def get_labelmap_slices_3(np_array):
        """Get a dictionary with the slices where all the label data are contained. The origin is a numpy array.
        Recall that the array will be read with Z,Y,X coordinates (because of the VTK conversion)
        Method 3: without compressing the array using where (VERY SLOW!)"""
        #start = time.clock() 
         
        # Search for all the different label maps
        labelMaps = np.unique(np_array)
         
        result = {}    
        for label in (label for label in labelMaps if label>0):
            # Get the slices that contain the label
            s = np.where(np_array == label)
            # "Translate" to the true slice numbers and store the result
            result[label] = np.unique(s[0]) 
        
    #     end = time.clock()
    #     print ("get_labelmap_slices_from_numpy_array (method2) took {0} seconds".format(end-start))
         
        return result
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_Common/CIP/logic/Util.py/Util.get_labelmap_slices_3/original