lama/registration_pipeline/validate_config.py
def convert_image_pyramid(self):
        """
        The elastix image pyramid needs to be specified for each dimension for each resolution.

        This function allows it to specified for just one resolution as it should always be the same for each dimension
        as we are assuming ispotropic data.

        If the the pyramid is already defined per dimesion, it will remain unchanged.


        Example
        -------
        # This pyramid shedule with a single isotropic factor for each stage will be converted to
        MovingImagePyramidSchedule = [6.0, 4.0, 2.0, 1.0, 1.0]

        # Will be converted to
        MovingImagePyramidSchedule = [ 6.0, 6.0, 6.0, 4.0, 4.0, 4.0, 2.0, 2.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,]

        Parameters
        ----------
        config: dict
            paramters

        """
        pyramid_keys = ['FixedImagePyramidSchedule', 'MovingImagePyramidSchedule']

        for stage in self.config['registration_stage_params']:
            elx_params = stage['elastix_parameters']

            for pk in pyramid_keys:
                if pk in elx_params.keys():

                    if elx_params.get('NumberOfResolutions'):
                        num_res = int(elx_params.get('NumberOfResolutions'))
                    else:
                        raise KeyError('NumberOfResolutions must be specified for each stage')

                    lama_schedule = elx_params[pk]

                    if len(lama_schedule) == num_res:
                        # pyramid is defined one value per stage
                        elastix_shedule = []
                        for i in lama_schedule:
                            elastix_shedule.extend([i, i, i])
                        elx_params[pk] = elastix_shedule

        The elastix image pyramid needs to be specified for each dimension for each resolution.

        This function allows it to specified for just one resolution as it should always be the same for each dimension
        as we are assuming ispotropic data.

        If the the pyramid is already defined per dimesion, it will remain unchanged.


        Example
        -------
        # This pyramid shedule with a single isotropic factor for each stage will be converted to
        MovingImagePyramidSchedule = [6.0, 4.0, 2.0, 1.0, 1.0]

        # Will be converted to
        MovingImagePyramidSchedule = [ 6.0, 6.0, 6.0, 4.0, 4.0, 4.0, 2.0, 2.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,]

        Parameters
        ----------
        config: dict
            paramters

        
The elastix image pyramid needs to be specified for each dimension for each resolution.
This function allows it to specified for just one resolution as it should always be the same for each dimension
as we are assuming ispotropic data.

If the the pyramid is already defined per dimesion, it will remain unchanged.

Example





Parameters

dict
paramters
The elastix image pyramid needs to be specified for each dimension for each resolution . This function allows it to specified for just one resolution as it should always be the same for each dimension as we are assuming ispotropic data . If the the pyramid is already defined per dimesion it will remain unchanged . Example Parameters dict paramters
def convert_image_pyramid(self):
        pyramid_keys = ['FixedImagePyramidSchedule', 'MovingImagePyramidSchedule']
        for stage in self.config['registration_stage_params']:
            elx_params = stage['elastix_parameters']
            for pk in pyramid_keys:
                if pk in elx_params.keys():
                    if elx_params.get('NumberOfResolutions'):
                        num_res = int(elx_params.get('NumberOfResolutions'))
                    else:
                        raise KeyError('NumberOfResolutions must be specified for each stage')
                    lama_schedule = elx_params[pk]
                    if len(lama_schedule) == num_res:
                        elastix_shedule = []
                        for i in lama_schedule:
                            elastix_shedule.extend([i, i, i])
                        elx_params[pk] = elastix_shedule
def convert_image_pyramid ( self ) : pyramid_keys = [ 'FixedImagePyramidSchedule' , 'MovingImagePyramidSchedule' ] for stage in self . config [ 'registration_stage_params' ] : elx_params = stage [ 'elastix_parameters' ] for pk in pyramid_keys : if pk in elx_params . keys ( ) : if elx_params . get ( 'NumberOfResolutions' ) : num_res = int ( elx_params . get ( 'NumberOfResolutions' ) ) else : raise KeyError ( 'NumberOfResolutions must be specified for each stage' ) lama_schedule = elx_params [ pk ] if len ( lama_schedule ) == num_res : elastix_shedule = [ ] for i in lama_schedule : elastix_shedule . extend ( [ i , i , i ] ) elx_params [ pk ] = elastix_shedule
The elastix image pyramid needs to be specified for each dimension for each resolution.
The elastix image pyramid needs to be specified for each dimension for each resolution .
"""
        The elastix image pyramid needs to be specified for each dimension for each resolution.

        This function allows it to specified for just one resolution as it should always be the same for each dimension
        as we are assuming ispotropic data.

        If the the pyramid is already defined per dimesion, it will remain unchanged.


        Example
        -------
        # This pyramid shedule with a single isotropic factor for each stage will be converted to
        MovingImagePyramidSchedule = [6.0, 4.0, 2.0, 1.0, 1.0]

        # Will be converted to
        MovingImagePyramidSchedule = [ 6.0, 6.0, 6.0, 4.0, 4.0, 4.0, 2.0, 2.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,]

        Parameters
        ----------
        config: dict
            paramters

        """ # pyramid is defined one value per stage
self