def calculate_number_of_neurites(morphology, node_types):
    """
        Returns the number of non-soma nodes in the morphology

        Parameters
        ----------

        morphology: Morphology object

        node_types: list (AXON, BASAL_DENDRITE, APICAL_DENDRITE)
        Type to restrict search to

        Returns
        -------

        Scalar value

    """
    nodes = morphology.get_node_by_types(node_types)
    return len(nodes)
